instruction
stringlengths
0
29.8k
⌀
|complexity-theory|time-complexity|computability|parameterized-complexity|
null
Our prof talked about why it's good to know that 3-SAT is NP-complete because it's easier to craft reductions from it than from plain SAT. However, all the examples we've seen (reduction to independent set, Hamiltonian cycle, etc.) seem to work even if we start from a SAT formula and not 3-SAT. **Is there an exam...
Reductions from 3-SAT that won't work from SAT
|complexity-theory|np-complete|reductions|np|satisfiability|
Our prof talked about why it's good to know that 3-SAT is NP-complete because it's easier to craft reductions from it than from plain SAT. However, all the examples we've seen (reduction to independent set, Hamiltonian cycle, etc.) seem to work even if we start from a SAT formula and not 3-SAT. **Is there an exam...
Reductions from 3-SAT that won't work directly from SAT
``` t <- n while t>1 do t <- log_2(t) ``` I tried to do it this way: $f^\text{(1)}(t)=\log_2(t) \\ f^\text{(2)}(t)=\log_2\log_2(t) = \log_2^{(2)}(t) \\f^\text{(3)}(t) = \log_2^{(3)}(t) \\ f^\text{(j-1)}(t) = \log_2^{(j-1)}(t) \\ f^\text{(j)}(t) = \log_2\log_2^{(j-1)}(t) = log_2^{(j)}(t) $ I...
Determine the time complexity of repeated logarithm until not greater than 1
We have an unstructured cloud of $N$ points in 3D space. What is known about the complexity of building the Euclidean Minimum Spanning Tree of the points ? The tree is made of $N-1$ edges and can be built as a subset of the Delaunay triangulation in time $O(N^2)$, but I don't think that this is tight.
What is the time complexity of the EMST problem in 3D space
|algorithms|graphs|time-complexity|
Can every undirected graph be transformed into an equivalent graph (for the purposes of path-finding) with a maximum degree of 3 in logspace? Given an undirected graph `G`, is there another graph, `H`, such that: - all vertices of `G` are in `H` - H is allowed extra vertices not in G - if `a` and `b` are conne...
Can every undirected graph be transformed into an equivalent graph (for the purposes of path-finding) with a maximum degree of 3 in logspace?
|graphs|space-complexity|
|algorithms|graphs|time-complexity|spanning-trees|
For each edge $(u,v)$ in $G$, add vertices $w_{u,v}$ and $w_{v,u}$ to $H$, and add the edge $(w_{u,v},w_{v,u})$ to $H$. For each vertex $u$ in $G$, if $u$ has edges $(u,v_1),\dots,(u,v_k)$, then add edges $(w_{u,v_i},w_{u,v_{i+1}})$ and $(u,w_{u,v_1})$ to $H$; and add edges $(w_{v_i,u},w_{v_{i+1},u})$ and $(w_{v_1,u...
Is it correct that, under a certain signature S, two First Order Logic formulae F and G are equisatisfiable if F is satisfiable under S iff G is satisfiable under S? But in Skolemization I’m confused because the signature ends up changing when fresh functions are added (when you remove the for-all quantifiers), so how ...
Simple Skolemization Question
|logic|satisfiability|first-order-logic|propositional-logic|
This is not the kind of problem you can just dump a single image and expect someone to be able to tell you how to solve it. It is likely that a solution will require considerable experimentation. It is hard to know a priori what might work. If you want to try classical computer vision techniques, you might start b...
This is not the kind of problem you can just look at a single image and expect someone to be able to tell you how to solve it. It is likely that a solution will require considerable experimentation. It is hard to know a priori what might work. If you want to try classical computer vision techniques, you might star...
Is it correct that, under a certain signature S, two First Order Logic formulae F and G are equisatisfiable if (F is satisfiable under S iff G is satisfiable under S)? But in Skolemization I’m confused because the signature ends up changing when fresh functions are added (when you remove the for-all quantifiers), so ho...
{"Voters":[{"Id":755,"DisplayName":"D.W."}],"SiteSpecificCloseReasonIds":[]}
<!-- Definitions: (selected from Appendix B.4 of that textbook). --> The meanings of path, simple path, cycle, simple cycle are defined in Appendix B.4 of that textbook. ------ Claim: Let edge $u$ lie on simple cycle $\mathcal C_u$. Let edge $v$ lie on simple cycle $\mathcal C_v$. $\mathcal C_u$ and $\mathcal ...
I believe I have come up with a solution, but I'm not convinced. We observe that, from `foldr(fn, acc, list)`, we can rewrite the intermediary steps as a series of single-valued functions: $$ \begin{align} eval_0 &: x \mapsto fn(list_0,x) \\ eval_1 &: x \mapsto eval_0(fn(list_1, x)) \\ \vdots \\ eval_n &: x \ma...
null
<!-- Definitions: (selected from Appendix B.4 of that textbook). --> The meanings of path, simple path, cycle, simple cycle are defined in Appendix B.4 of that textbook. ------ Claim: Let edge $u$ lie on simple cycle $\mathcal C_u$. Let edge $v$ lie on simple cycle $\mathcal C_v$. $\mathcal C_u$ and $\mathcal ...
I have a 3D space where spheres of identical size, identified by the location of their centers, are continually inserted. When a new sphere is inserted, I have the ability to efficiently query the locations of any other spheres that may intersect with this sphere. I can also compute the vector two intersecting spher...
Efficiently remove intersections among a set of spheres
|algorithms|optimization|computational-geometry|mathematical-programming|
Let's assume that I am continuously receiving big amount of data. For example, this millisecond I get 100 numbers, next millisecond I get another 500 numbers, after that I might get nothing for a several milliseconds and then again get some numbers in the next millisecond. Also assume that this process lasts for weeks....
Choice of data structure to contain last 5 minutes of long continuous data stream
|algorithms|data-structures|queues|
I'm trying to find an optimal combination of players given certain constraints. There are ~300 players. 10 players has to be chosen in the combination. Each player has an assigned value. The goal is to optimize for the sum of their values. Constraints: - Each player has a price. The sum of their prices has ...
Finding optimal combination with multiple constraints
|algorithms|optimization|dynamic-programming|knapsack-problems|
In the minimum edge cover problem, you have to find a smallest set of edges that covers all of the vertices. The first thing you want to do is decide which edges you want to include in your edge cover. This can be done by having a variable $x_e\in \{0, 1\}$ for each edge $e$ of the graph. If $x_e=1$, you include the ed...
I suggest you express this as an instance of integer linear programming, and use an off-the-shelf ILP solver. You will have a 0-or-1 variable $x_i$ for each player, where $x_i=1$ means that the $i$th player is selected and $x_i=0$ means that the $i$th player is not selected. Each constraint you list can be expressed ...
I have a 3D space where N spheres of identical size, identified by the location of their centers, are continually inserted. When a new sphere is inserted, I have the ability to efficiently query the locations of any other spheres that may intersect with this sphere. I can also compute the vector two intersecting sph...
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
Question about arithmetic unit in nandgame.com and energy usage in CPUs
|cpu|
null
A plausible algorithm is to use a physics simulation of the balls: simulate moving that one ball along that vector, and let it bump other balls out of the way (which might in turn cause a cascading reaction, etc.). This probably won't yield an optimal solution but it will be an efficient way to obtain one plausible so...
**Are the halting problem proofs refuted by software engineering ?** This is an explanation of a possible new insight into the halting problem provided in the language of software engineering. Technical computer science terms are explained using software engineering terms. No knowledge of the halting problem is requ...
Are the halting problem proofs refuted by software engineering?
Let $L_1 \in NP, L_2 \in NPC$. It is known that if $L_1 \in P$ then $L_2 \in P$. Can we formally deduce that $L_1 \in NPC$ (show that $\forall L'\in NP$ exists a polynomial reduction $L'\leq_p L_1$)?
For $L_1 \in NP, L_2 \in NPC$, does $L_1 \in P \Rightarrow L_2 \in P$ imply $L_1 \in NPC$?
|complexity-theory|computability|
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
null
null
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
This arithmetic unit in https://nandgame.com shows two inputs that can go into four different calculations, and the multiplexers then chooses an answer based on the op1 and op2 inputs. It seems to me that the arithmetic unit actually does *all* calculations every time, but only outputs one answer. Is that the case in C...
I was playing https://nandgame.com and noticed that the arithmetic unit of the ALU was doing both the add and subtract operation in parallel, but only asks for one operation per instruction. This to me seemed like it wasted resources, and I was interested in if this was a normal design-pattern in ALUs/CPUs. My question...
Do ALUs tend to do operations in parallel even if they are not selected by the machine instruction?
I think the answer is unknown. In particular: suppose the way we know that "if $L_1\in P$ then $L_2 \in P$" is because we have a Cook reduction from $L_2$ to $L_1$. I believe it is not known whether this implies the existence of a Karp reduction from $L_2$ to $L_1$ (which is equivalent to $L_1$ being NP-complete). ...
I was playing https://nandgame.com and noticed that the arithmetic unit of the ALU was doing both the add and subtract operation in parallel, but only asks for one operation per instruction. This to me seemed like it wasted resources, and I was interested in if this was a normal design-pattern in ALUs/CPUs. My question...
null
I was playing nandgame.com and noticed that the arithmetic unit of the ALU was doing both the add and subtract operation in parallel, but only asks for one operation per instruction. This to me seemed like it wasted resources, and I was interested in if this was a normal design-pattern in ALUs/CPUs. My question is, bro...
null
null
null
The implication is true if and only if $P = NP$. If $P = NP$, the consequent $L_1 \in NPC$ is true from the assumption $L_1 \in NP$ because $NP = NPC$. If $P \neq NP$, there exists an [NP-intermediate](https://en.wikipedia.org/wiki/NP-intermediate) problem. Now, assign $L_1$ to be an NP-intermediate language, and...
[![enter image description here][1]][1] [1]: https://i.stack.imgur.com/BemYt.png I'm confused about the complexity of the recurison formula above, why $T(n)=O(nlog^2(n)/loglogn)$?
The complexity of a recursion formula
|runtime-analysis|
Let $S$ be an array of length $n$ containing a random permutation of numbers from $1$ to $n$. What is the most efficient algorithm for finding the location of a given number $k$ in $S$? In other words, finding index $i$, such that $S[i]=k$.
Efficient search in a permutation
|algorithms|search|
Let $S$ be an array of length $n$ containing a random permutation of numbers from $1$ to $n$. What is the most efficient (in expectation) algorithm for finding the location of a given number $k$ in $S$? In other words, finding index $i$, such that $S[i]=k$.
Linear search. Reading values from $S$ give you no information on where $k$ can be. If the permutations are equiprobable, whatever the order in which you try the locations, the distribution of the number of trials is uniform. The expectation of the number of comparisons is $\dfrac{n-1}2$ (best case $1$, worst $n-1$)...
Linear search. Reading values from $S$ give you no information on where $k$ can be and you can't avoid exhaustive search. If the permutations are equiprobable, whatever the order in which you try the locations, the distribution of the number of trials is uniform. The expectation of the number of comparisons is $\dfr...
Let $S$ be an array of length $n$ containing a random permutation of numbers from $1$ to $n$. What is the most efficient (in expectation) algorithm for finding the location of a given number $k$ in $S$? In other words, finding index $i$, such that $S[i]=k$. I watched a video about a related [puzzle][1] and it seems ...
Linear search. Reading values from $S$ give you no information on where $k$ can be and you can't avoid exhaustive search. If the permutations are equiprobable, *whatever the order* in which you try the locations, the distribution of the number of trials is uniform. The expectation of the number of comparisons is $\d...
In reading the paper "a strip-packing algorithm with absolute performance bound 2", the author gives a recursion formula $T(l)=T(l')+T(l'')+O(min\{l'\log{l'},l''\log{l'}',l\})$, where $l'+l''=l$,$l'>0$,$l''>0$, I'm confused about the complexity of the recurison formula, how to obtain $T(n)=O(n\log^2(n)/\log\log n)$?
|recursion|
|algorithm-analysis|recursion|
In reading the paper "a strip-packing algorithm with absolute performance bound 2", the author gives a recursion formula $T(l)=T(l')+T(l'')+O(min\{l'\log{l'},l''\log{l'}',l\})$, where $l'+l''=l$,$l'>0$,$l''>0$, I'm confused about the complexity of the recurison formula, how to obtain $T(n)=O(n\log^2(n)/\log\log n)$?\ ...
The complexity of Steinberg's strip-packing algorithm
The current [Wikipedia article](https://en.wikipedia.org/w/index.php?title=Euclidean_minimum_spanning_tree&oldid=1094988780#Higher_dimensions) has information: > For three dimensions it is possible to find the minimum spanning tree in time $O((n \log⁡ n)^{4/3})$ And about approximation: > it is possible to pro...
I have a problem where I have to find all the pairs of a list of People where the sum of their age is equal to a given number under time complexity less than O(N²) **Eg:** **Input:** {(Jhon, 10),(mary,20),(paul,10),(joseph,15)} Sum:30 **Expected results:** {(John, Mary), (Mary, ...
Is it posible to find all unique pairs of People with age equal to a given number in less than O(n²)
|dynamic-programming|search-algorithms|hash|combinatory-logic|
null
Yes, your guess is indeed correct.
Lets take a smaller example. Consider you have $10$ positions $[0, 1, 2, ..9]$ and the numbers are distributed as position $i$ has the number $(i + 1)mod10$. Now pick any $k$, it's easy to see that you'll have to traverse all the positions. So asymptotically, you have no benefit. As far as expectation is concerned @...
Let $S$ be an array of length $n$ containing a random permutation of numbers from $0$ to $n-1$. What is the most efficient (in expectation) algorithm for finding the location of a given number $k$ in $S$? In other words, finding index $i$, such that $S[i]=k$. I watched a video about a related [puzzle][1] and it seem...
Definitions - Actually, there are three definitions of FPT, already in the Downey/Fellows book. - The definition you cite is known as _strongly uniform FPT_. - Dropping the computability requirement on $f$ (as you suggest) gives _weakly uniform FPT_. - For _nonuniform FPT_, one requires an exponent $c$ and, for ...
Let $S$ be an array of length $n$ containing a random permutation of numbers from $0$ to $n-1$. What is the most efficient (in expectation) algorithm for finding the location of a given number $k$ in $S$? In other words, finding index $i$, such that $S[i]=k$. --- I watched a video about a related [puzzle][1] and ...
I am trying to understand **why the ellipsoid method is not a strongly polynomial time algorithm for linear programming**. Using wikipedia's definition, an algorithm runs in strongly-polynomial time if: 1. The number of operations in the arithmetic model of computation is bounded by a polynomial in the number of in...
Why is the ellipsoid method for linear programming only weakly polynomial time?
|complexity-theory|polynomial-time|linear-programming|
Suppose that you are given an algorithm A that finds the optimanl solutionto the shortest lattice vector problem (SVP) in time $t(n)$ I am trying to solve the <b>Small even set problem (SES)</b> using it: The input is a set $S$ of $m$ vectors $v_1,...,v_m$ with each $v_i$ in $\{0,1\}^d$. The goal is to find a non-e...
Solving Small even set problem (SES) using Shortest lattice vector problem (SVP)