instruction stringlengths 0 29.8k ⌀ |
|---|
null |
This answer is a bit more broad. The words safe and safety have in recent decades been mutilated by certain politically oriented parts of English-speaking society, such that the common usage has almost no definition. However, for technical matters I define "safety" and "safe" as a device(physical or procedural) that pr... |
I recently designed an algorithm for single-source shortest paths in graph structures, which can limit the number of transfers as Bellman-Ford while approaching the performance of SPFA. Of course, it also supports negative weights and helps check the negative weight cycle.
The runtime ratio is ```SPFA : Mine : Bellm... |
Consider the following decision problem:
Given $([b_1, \cdots, b_n],t)$, where $[b_1, \cdots b_n]$ is an array of natural numbers and $t \le n^c$, do there exists natural numbers $f_1, \cdots f_n$ such that
1) $f_i \le b_i$ for all $1 \le i \le n$
2) $\prod_{i=1}^{n} f_i = t$?
We guess that if the prime facto... |
Variant of Bounded Subset Product |
|complexity-theory|np-complete| |
I very much doubt this is suitable for publication in Nature or Science.
Theoretical computer scientists will care about proofs of correctness and the best provable upper bound on the worst-case running time. Until you have that, you don't have much, and it is unlikely that researchers will pay attention.
I don'... |
I think there must be some confusion in the problem setting. Given an input of $n$ bits chosen uniformly at random, there is no algorithm to compress it to something whose length is on average shorter than $n$ bits. This is a pure information theoretic fact, that holds regardless of how much computation power you thr... |
Say i have an 2d array A of nxn size, int values already given for each item.these values can be the same or different.
There's gonna be another nxn array B being input. I can only interchange one row to another, or one col with another from B. Basically if an item shares a row/col with another, even if shifted they'l... |
null |
Consider the variant of the Subset Sum problem, where the input is a list of $2 m + 1$ positive integers of sum $2 S$, and the goal is to find a subset with the largest sum that is at most $S$. The problem is NP-hard in general, but it can be solved in polynomial time if the all inputs are 'big', that is, larger than $... |
Subset sum problem with big items |
|np-hard|polynomial-time|subset-sum| |
It would be pointless. A well implemented sieve can find prime numbers much faster than you could ever download them. |
It would be pointless. A well implemented sieve can find prime numbers much faster than you could ever download them.
Now creating a sieve storing a large number of primes will make trial division faster, since only about $2\cdot \sqrt n / \ln n$ divisions will be needed in the worst case.
But for large n prima... |
null |
It is easy to compute the centroid (center-of-mass) of an ellipsoid in $\mathbb{R}^d$.
I want to compute the centroid of a body of the following form:
$$
E\cap H_1\cap \cdots H_T
$$
where $E$ is an ellipsoid, and $H_1,\ldots,H_T$ are half-spaces.
Can this be done in time polynomial in $d$ (the dimension) and ... |
Computing the centroid of an "ellipsoid slice" |
|optimization|computational-geometry| |
To find the maximum matching on a bipartite graph, I propose the following greedy algorithm:
At each iteration, pick an unmatched vertex with the smallest degree and match it to one of it's neighbours if possible. Remove the 2 matched vertices and all of it's edges from the graph and repeat till the graph is empty.
... |
Greedy Maximum Bipartite Matching |
|greedy-algorithms|bipartite-matching| |
considering a directed unweighted graph (in a adjacency matrix for example), how can i visit each node exactly once? by once i mean for example in a dfs traversal, a node can get finnished and we should go back to it's parent node and try other paths. but what's an algorithm that doesn't get back to the parent node at ... |
visiting all nodes of a directed graph exactly once (not dfs) |
|greedy-algorithms|minimum-spanning-tree|hamiltonian-path| |
We are given two cyclic $\{0,1\}$ strings $X$ and $Y$ with both length $n$, containing $k$ 0s and $n-k$ 1s. Suppose positions of 1 in $X$ are $x_0,\dots,x_{k-1}$, for $Y$ are $y_0,\dots,y_{k-1}$. We assume $x_0=y_0=0$. Find $c \in \{0,\dots,n-1\}$ and $s \in \{0,\dots,k-1\}$ minimize $$ \sum_{i=0}^{k-1} d(x_i,y_{(i+s) ... |
-------------------ignore-------------------- |
|computer-networks| |
I want to compute the centroid of a body of the following form:
$$
E\cap H_1\cap \cdots \cap H_T
$$
where:
* $E$ is an ellipsoid in $\mathbb{R}^d$: $E = \{x = c + Bu | u^T u \leq 1\}$, where $c$ is the ellipsoid center and $B$ is a matrix.
* $H_1,\ldots,H_T$ are half-spaces.
Can this be done in time polynomi... |
To find the maximum matching on a bipartite graph, I propose the following greedy algorithm:
At each iteration, pick an unmatched vertex with the smallest degree and match it to one of it's neighbours if possible. Remove the 2 matched vertices and all of it's edges from the graph and repeat till the graph is empty.
... |
|greedy-algorithms|bipartite-matching| |
I recently designed an algorithm for single-source shortest paths in graph structures, which can limit the number of edges as Bellman-Ford while approaching the performance of SPFA. Of course, it also supports negative weights and helps check the negative weight cycle.
The runtime ratio is ```SPFA : Mine : Bellman-F... |
A more intuitive example. Optimal path changed from ABCDE to AE after addition of the cost of each step
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/Maiut.jpg |
null |
It would be pointless. A well implemented sieve can find prime numbers much faster than you could ever download them.
Now creating a sieve storing a large number of primes will make trial division faster, since only about $2\cdot \sqrt n / \ln n$ divisions will be needed in the worst case.
But for large n prima... |
null |
Consider the variant of the Subset Sum problem, where the input is a list of $2 m + 1$ positive integers of sum $2 S$, and the goal is to find a subset with the largest sum that is at most $S$. The problem is NP-hard in general, but it can be solved in polynomial time if the all inputs are 'big', that is, larger than $... |
null |
You are asking for a Hamiltonian Path (or a Hamiltonian cycle if you need to return to your original starting point).
https://en.wikipedia.org/wiki/Hamiltonian_path
It is NP-hard to determine whether a graph has such a Path. That is, there is no known polytime algorithm for it, and if you are trying to code up yo... |
Consider we use a RAM model with word length w (or if you really want a more exact model, you can use [Knuth's MMIX](https://www-cs-faculty.stanford.edu/~knuth/mmop.html) [instructions](https://mmix.cs.hm.edu/doc/instructions-en.html) with w-bit numbers).
Given a number n, we want to compute the most significant dig... |
null |
Consider a directed unweighted graph (in a adjacency matrix for example), how can I visit each node exactly once? By once I mean for example in a DFS traversal, a node can get finished and we should go back to it's parent node and try other paths. But what's an algorithm that doesn't get back to the parent node at all ... |
Visiting all nodes of a directed graph exactly once (not dfs) |
null |
null |
null |
null |
In NP I could guess the disjunctive normal form of the formulas, that would look like
$\bigwedge_i R_i(x_1^i, \ldots, x_{n(i)}^i) \land \bigwedge_j \lnot R_j(x_1^j, \ldots, x_{m(j)}^j)$
The question is then how to decide satisfiability of this term.
One could then take the relation to be the tuple of variables... |
I'm learning about induction and co-induction. From what I know, given a set of judgments $U$ and an inference system $\Phi \subseteq \wp(U) \times U$, where $(\left\{ h_1,\dots,h_n \right\}, c) \in \Phi$ stands for the rule $\frac{h_1 \quad \dots \quad h_{n}}{c}$, we can define the function:
$ F_{\Phi}(X) = \left... |
(Co)-induction, fixpoints and inference systems |
|logic|fixed-point|coinduction| |
I recently came up with this bin packing variant and was wondering, if someone has studied it before:
Given: Instance $I$ is a set of tuples $\begin{pmatrix}s_{i} \\ o_{i}\end{pmatrix}$ with $s_{i}, o_{i} \leq 1$ and $s_{i} \leq o_{i}$ for all $i$.
Task: Pack the items in $I$ into the least amount of bin with size... |
Approximation Algorithm for Bin packing Variant with Packing Overhead |
|np-hard|approximation|knapsack-problems|packing| |
I'm a student trying to learn more about CMOS design, I already understand assembly and computer architecture, but VLSI is very interesting and I was wondering if you guys knew some good books/games in order to learn more. I already know how to use electric, and I just want to know more about this topic. Also, I don't ... |
What are some good books for vlsi cmos design? Or some good educational software? |
|computer-architecture|digital-circuits| |
null |
Let $S_\ge = \{\langle M \rangle \mid |L(M)| \ge 10\}$. You can prove that it is Turing-recognizable by applying the definition directly. The following algorithm terminates on machines in $S_\ge$ and runs forever on machines that are not in $S_\ge$:
* For $k = 0,1,2,\ldots$:
* Let $c := 0$
* For every st... |
null |
null |
Below depicts a FIFO buffer:
[![stagnate][1]][1]
So the buffer is there for when the speed of data written into the FIFO buffer is faster than the data read.
But I don't understand one thing. Wouldn't eventually all the free buffers of the FIFO buffer run out after certain amount of time? Because writing spe... |
Will a FIFO buffer eventually stagnate? |
|data-structures| |
null |
null |
The buffer is useful if data comes in bursts. 1000 items in a second then 10 seconds nothing and repeat, while the reader reads consistently 100 items per second. Without the buffer, it would take ten seconds to process the 1000 items, then ten seconds nothing - about twice as long.
Yes, if the average write speed ... |
Intuitively, you can see that $F_\Phi(X)$ is monotone in $X$ by carefully looking at the body of the definition
$$ \exists (H, c)\in \Psi,\ H\subseteq X$$
If there is an $H, c$ with $H\subseteq X$, then definitely the same $H$ will work if $X$ is taken to be larger!
You are correct about the identity deduction... |
Classic text (Linz, P., & Rodger, S. H. (2022). An introduction to formal languages and automata. Jones & Bartlett Learning.) describes the following language where one is to describe an nondeterministic pushdown automata (chapter 8 problem 4j fifth edition) :
Describe a language over {a,b}
where the count of b's ... |
Two Counter word count language npda' problem actually Context Sensitive unless counters are multiples |
Classic text (Linz, P., & Rodger, S. H. (2022). An introduction to formal languages and automata. Jones & Bartlett Learning.) describes the following language where one is to describe an nondeterministic pushdown automata (chapter 8 problem 4j fifth edition) :
Describe a language over {a,b}
where the count of b's ... |
|context-free|pushdown-automata| |
Two Counter word count language npda' problem actually Context Sensitive unless counters are multiples |
|context-free|pushdown-automata| |
Classic text (Linz, P., & Rodger, S. H. (2022). An introduction to formal languages and automata. Jones & Bartlett Learning.) describes the following language where one is to describe an nondeterministic pushdown automata (chapter 8 problem 4j fifth edition) :
Describe a language over {a,b}
where the count of b's ... |
Two Counter word count language npda' problem actually Context Sensitive unless counters are multiples |
|context-free|pushdown-automata| |
Two Counter word count language Nondeterministic Pushdown Automata (NPDA) problem actually Context Sensitive unless counters are multiples |
I'm trying to understand reaching definitions and I'm having hard problem wrapping it around my head with the following definition
[![enter image description here][1]][1]
Why part of the expression of `ReachOut(Bi)` is set to be the `ReachIn(Bi) - Kill(Bi)` if for every assignment say `a = b + c` we **kill** the ... |
data flow analysis reaching definition analysis meaning |
|data-flow-analysis| |
I have an algorithmic problem in which I have a highway that is a straight line of length n and a set of unique respective costs for construction of a radio tower for each mile on the highway. I am trying to use dynamic programming to find a way to minimize the cost of ensuring that each point in the highway is covered... |
Dynamic programming problem for minimum cost tower placement |
|algorithms|dynamic-programming| |
null |
null |
I recently designed an algorithm for single-source shortest paths in graph structures, which can limit the number of edges as Bellman-Ford while approaching the performance of SPFA. Of course, it also supports negative weights and helps check the negative weight cycle.
The runtime ratio is ```SPFA : Mine : Bellman-F... |
{"OriginalQuestionIds":[163219],"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
{"OriginalQuestionIds":[163219],"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
Given an `isothetic` polygon (sides parallel to x axis or y axis) and 2 points (start and end) on the boundary of the polygon,
find a path traveling only in the direction of x or y axis (up, right, down, left), such that the entire polygon is visible by the time a point travels from start point to the end point.
[![... |
Shortest path in polygon from 2 points such that entire polygon is visible |
|computational-geometry| |
Given an isothetic polygon (sides parallel to x axis or y axis) and 2 points (start and end) on the boundary of the polygon,
find a path traveling only in the direction of x or y axis (up, right, down, left), such that the entire polygon is visible by the time a point travels from start point to the end point.
[![Po... |
1. Negation is certainly possible in these systems. It's discussed in the best introductory materials, in particular:
https://www.irif.fr/~gc/papers/covcon-again.pdf
https://pnwamk.github.io/sst-tutorial/
This however doesn't have anything to do with double negation elimination or classical logic.
2. As to why the... |
null |
You will need some **discrete mathematics**. Graphs, trees, and so forth are the structures underlying AI.
You will need some **programming** skills, especially in languages such as Prolog and LISP.
A lot of AI systems are programmed in these languages.
You will need some **logic**. Propositional and predicate ... |
null |
**Problem:**
There are L lists of positive integers, say L_0, L_1, L_2 ... L_|L|-1.
The lists have equal length.
There is a target number T.
Find what is the combination of elements, one element from each list, whose average is the closest to T.
**Example:**
L_0 = [10, 20, 15]
L_1 = [9000, 4... |
null |
In [this paper][1] Claim 1 states that *x* and *y* are smallest probability and *there is optimal code tree in which these two characters are siblings at the maximum depth*. In proof to that claim, author starts with tree *T* which has *b* and *c* at the maximum depth of tree.
I can't understand why tree *T* is call... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.