instruction
stringlengths
0
29.8k
⌀
Consider what happens if I find a polynomial time solution for an NP complete problem. Say a solution taking $n^{100}$ nanoseconds on my computer. For n = 2 that’s $2^{100} \approx 10^{30}$ nanoseconds. Or $10^{21}$ seconds. Or 30 trillion years. So all but the smallest instance are not trivial, but practically uns...
Consider what happens if I find a polynomial time solution for an NP complete problem. Say a solution taking $n^{100}$ nanoseconds on my computer. For n = 2 that’s $2^{100} \approx 10^{30}$ nanoseconds. Or $10^{21}$ seconds. Or 30 trillion years. So all but the smallest instance are not trivial, but practically uns...
recursively enumerable and linear bounded automaton
null
# Problem definition The world consists of an infinite three-dimensional cartesian grid, i.e. every position is in $P = \mathbb{Z}^3$. Neighbours of a position $p \in P$ are defined by $N(p) = \{p + e_1, p - e_1, p + e_2, p - e_2, p + e_3, p - e_3\}$, where $e_i$ are the unit vectors, for example $e_1 = (1,0,0)^T...
Optimal torch placement in voxel games
|algorithms|optimization|
Currently P vs NP is the holy grail of theoretical computer science. And the nature of the problem is as such that if actually P = NP is proved then most of the proofs for mathematical statements would be trivial to find, and on the exact other end if P != NP is proved then one would appreciate the hardship of finding...
( Soft question ) P vs NP - is such a situation possible?
null
There is not likely to be any exact formula, but we can investigate the asymptotic behavior. If $p$ is a little bit larger than $(\log n)/n$, then with high probability there exists a maximum matching, so the expected size of the maximum matching is close to $n$. See https://math.stackexchange.com/q/1267387/14578. ...
Your error is in the sentence "Xp doesn't hold, hence ¬Xp holds". In your example, neither Xp nor ¬Xp hold for the model: of the two possible traces in the model, the upper branch only satisfies Xp, and the lower branch only satisfies ¬Xp. Neither Xp nor ¬Xp hold for _all traces in the model_, so neither of these LTL f...
Ok, I want to interpret this question as: what is the biggest growth rate a term $t$ of size $|t| = C$ can have, after $n$ $\beta$-reductions (as a function of $n$). There are several different interpretations for the question, as well as within the question: for example, am I allowed to pick _which_ $\beta$-reducti...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
Given a set $S$ of $n$ positive integers $S=\{a_1,\ldots,a_n\}$, can we partition $S$ into $k$ subsets of equal sum such that each subset has contiguous elements from $S$? Is this variant of $k$-wat number partitioning NP-hard?
$k$-way number contiguous partitioning
|partitions|
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
null
null
null
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs. I'm only going to sketch the general idea of the reduction, so I'll be somewhat...
Is there any books, papers or articles on how to analyze the time complexity of programs written in lazy languages such as Haskell? I know how laziness is implemented and how it can be expanded and thus analyzed, but is there any more intuitive methods that does not go deep into the low level implementation principl...
I am trying to implement a multi-agent path planning algorithm that works on non-planar graphs and large agents (that is, collisions may at the intersection of two edges and at points where the edges run beside each other, if the euclidean distance is small enough). For context, one can imagine the given graph as ...
Collaberative Multi Agent Path planning on directional and non-planar graph
|constraint-satisfaction|routing|path|
Collaborative Multi Agent Path planning on directional and non-planar graph
null
No, assuming $\mathsf{P} \neq \mathsf{NP}$ there is no efficient algorithm for optimal torch placement, even if the world is just a 2D grid. This can be shown by providing a reduction from the vertex cover problem on cubic planar graphs, which is [known to be $\mathsf{NP}$-hard](https://www.sciencedirect.com/science...
null
An efficient way to find a pair of unrelated edges
Consider what happens if I find a polynomial time solution for an NP complete problem. Say a solution taking $n^{100}$ nanoseconds on my computer. For n = 2 that’s $2^{100} \approx 10^{30}$ nanoseconds. Or $10^{21}$ seconds. Or 30 trillion years. So all but the smallest instance are not trivial, but practically uns...
null
null
Given a set $S$ of $n$ positive integers $S=\{a_1,\ldots,a_n\}$, can we partition $S$ into $k$ subsets of equal sum such that each subset has contiguous elements from $S$? Here, a contiguous subset is in the form $\{a_i,a_{i+1},a_{i+2},\ldots\}$ for some $i$. For example, with $S=\{3,6,2,1\}$, possible contiguous su...
## Why bit-based computer models? ## The perhaps most commonly used computer model is a random access machine that can store natural (or even real) numbers in infinitely many cells indexed by natural numbers. This model's main benefit is that it greatly simplifies calculating Runtimes, as arithmetic and indexing are...
How are pointers modeled on bit-based computer models?
|time-complexity|asymptotics|computer-architecture|runtime-analysis|computation-models|
This variant is NP-Hard if and only if $P = NP$. You can design an easy linear-time greedy algorithm for this problem by observing that the sum of the numbers in each set of the partition must be exactly $T =\frac{1}{k} \sum_{i=1}^{n} a_n$. Since all $a_i$ are integers, the answer can only be yes if $T$ is an inte...
For a precise problem statement, first describe how a “standard” elevator setup works. Human users are supposed to know how it works and do things to get where they want to get. There are lifts, floors, and a scheduler. Lifts are in the “up”, “down” or “idle” mode. They are standing still or they are moving. When st...
The problem is in $\mathsf{P}$ (and is not trivial), hence it is $\mathsf{NP}$-Hard if and only if $\mathsf{P} = \mathsf{NP}$. In particular, you can design an easy linear-time greedy algorithm by observing that the sum of the numbers in each set of the partition must be exactly $T =\frac{1}{k} \sum_{i=1}^{n} a_n$....
I'm building some teaching tools for teaching the lambda calculus and would like some kind of visual representation of it. I've looked at [Alligator Eggs][1] and while it is something very similar to what I'm looking for, I would like something that expresses church numerals in a more elegant way. What other visual/...
What are some visual representations of the lambda calculus?
|lambda-calculus|education|
null
The problem is in $\mathsf{P}$ (and is not trivial), hence it is $\mathsf{NP}$-Hard if and only if $\mathsf{P} = \mathsf{NP}$. In particular, you can design an easy linear-time greedy algorithm by observing that the sum of the numbers in each set of the partition must be exactly $T =\frac{1}{k} \sum_{i=1}^{n} a_n$....
First, can the Navier-Stokes problem be a formal computable one? like a P problem? Then, how to define the corresponding language? Would it only be the set of equations, or something else? Then, could the size of the input vary if the problem was the three dimensions one? Seems not if the number of equations is limited...
If the Navier-Stokes equations problem is a computable problem, for example a set/language called "L", what are the elements of L?
|computability|decision-problem|p-vs-np|
Languages are a good way of discussing _yes or no_ questions with a _finite bit-length input size_. There are plenty of alternatives to languages, in complexity theory! They often have some 'moral equivalence' to languages. Two important cases are _Function problems_ and _Approximation problems_. Function problem...
It sounds like you're just asking for the definition of [Random-access machine][1], which is similarly formal to Turing machines, but formally defines how to do "indexing" operations. There's also easy ways to equip a Turing machine with random access capabilities. You give it an extra "index" tape that it can only ...
As you know, big-O notation hides all constants. For instance both runtimes $T_1=n$ and $T_2=10^{10}n$ are considered to be linear ($\mathcal{O(n)}$). Is there any iconic problem whose best known solution has a terrible (large) constant in the runtime expression?
is there a known polynomial time complexity problem with bad constant?
|complexity-theory|time-complexity|
Take the [Speck cipher][1] 32-bit block size variant, the key size is not important for you therefore select any of the 64,72, or 96-bit versions. The steps 1. select a uniform random key $k$ and store it. 2. keep a counter $counter = 0$ 3. When need a new ID, encrypt $c$ with the key $$ID = Speck32_k(count...
Such algorithms are called [Galactic Algorithms](https://en.wikipedia.org/wiki/Galactic_algorithm).
Please explain to me if this is true or false. I had this in an exam, and I really need to know if I got this correct. I believe it is true because finite problems have finite solutions, which can be done in polynomial time.
True or false? Any finite problem is in P
|complexity-theory|
If by finite problem, you mean a problem with a finite domain, then yes. Such problems are not only in P, but can be done in constant time since you can build a mapping between every possible input and its correct output.
```` L= {abc} prefix = {epsilon,a,ab,abc} suffix = {epsilon,c,bc,abc} ```` It's easy to find suffixes and prefixes for finite languages. But what will be the approach for infinite languages? For example:- ```` Alphabet = {a,b} L1 = Every string starts with a. L2 = Every string ends with a. L3 = {waw|w be...
How to find prefixes and suffixes for infinite languages? (Automata)
|regular-languages|automata|finite-automata|closure-properties|
We got the following tasks in our Higher Algorithm class, to repeat our proof techniques from class: > 1) Find asymptotic upper bounds (as sharp as possible) for $T(n)$ in each of the following cases, > using your favorite method. <br /> > You may assume that $T(n) < 10$ for all > $0 ≤ n ≤ 5$. Where me and m...
Solving Recurrence Relations with induction
|time-complexity|algorithm-analysis|recurrence-relation|induction|
Since you already noticed that the solution to D) appears to be $T(n) = H_n$, where $H_n = \sum_{i=1}^n \frac{1}{i}$ is the $n$-th harmonic number, why don't you use exactly this guess for the induction proof? Assuming $T(1)=1$, you have: - Base case: For $n=1$, $T(1)=1=H_1$. - Inductive step, assume that $n>1$ an...
Since you already noticed that the solution to D) appears to be $T(n) = H_n$, where $H_n = \sum_{i=1}^n \frac{1}{i}$ is the $n$-th harmonic number, why don't you use exactly this guess for the induction proof? Assuming $T(1)=1$, you have: - Base case: For $n=1$, $T(1)=1=H_1$. - Inductive step, assume that $n>1$ an...
Take the [Speck cipher][1] 32-bit block size variant, the key size is not important for you therefore select any of the 64,72, or 96-bit versions. The steps 1. select a uniform random key $k$ and store it. 2. keep a counter $counter = 0$ 3. When need a new ID, encrypt the $counter$ with the key $$ID = Speck...
null
I have read online and seen websites saying the optical disk drive is a storage device. In my opinion, the optical disk drive only writes data to the optical disk so it's not a storage device, am I wrong??
Is the optical disk drive an input device?
|computer-architecture|
null
**Equation for projection:** ${ t ∣ ∃z ( R(z) ∧ t.name = z.name }$ Now, here we don't specify anywhere that $R(t)$ or $t \ belongs \ to \ relation \ R$. So, $t$ is basically just empty tuple with no specified attributes. The only thing we specified here is that $R(z)$ which makes $z$ a tuple with all other att...
Let's see what others say but I think you could adapt the algorithm that enumerates the sentences of a language and restrict it to enumerate prefixes or suffixes only. I assume you are familiar with formal languages, the algorithm I sketched takes advantage of standard notation and well-known techniques. An algori...
null
null
In simple precision format, the largest possible positive number is $A = 0 ~~~ 11111110 ~~~ 111\ldots 111$ Its predecessor is $B = 0 ~~~ 11111110 ~~~ 111 \ldots 110$ But what is the absolute difference (in decimal) between these? Appealing to scientific notation, $A = 0.(2^{22}+2^{23}+\ldots + 2 + ...
Absolute difference between largest IEEE754 number and its predecesor
|floating-point|binary|
null
Given sets `A`, `B`, `C` with a parent<->child relationship between `A` and `B`, and `B` and `C`. There are concurrent attempts to modify the data. Each concurrent modification has access to `(a1, a2)` in `(A, A)` different from all other modification attempts and `a1 != a2`. Each concurrent modification may change...
Concurrent datastructure modification
|data-structures|concurrency|
Given sets `A`, `B`, `C` with a parent<->child relationship between `A` and `B`, and `B` and `C`. There are concurrent attempts to modify the data. Each concurrent modification has access to `(a1, a2)` in `(A, A)` different from all other modification attempts and `a1 != a2`. Each concurrent modification may change...
Given sets `A`, `B`, `C` with a parent-child (one to many) relationship between `A` and `B`, and `B` and `C`. There are concurrent attempts to modify the data. Each concurrent modification has access to `(a1, a2)` in `(A, A)` different from all other modification attempts and `a1 != a2`. Each concurrent modificatio...
I was given the following problem called the barter economy problem: Given a set of $n$ people $\{p_1, \ldots, p_n\}$ and a set of $m$ distinct objects $\{a_1, \ldots, a_m\}$, where each object $a_j$ is owned by exactly one person, and each person $p_i$ has a valuation function $v_i$ such that $v_i(a_j)$ is a non-negat...
Subset sum reducible to barter economy problem?
|np-hard|np|decision-problem|
|np-complete|np-hard|np|decision-problem|
I was given the following problem called the barter economy problem: Given a set of $n$ people $\{p_1, \ldots, p_n\}$ and a set of $m$ distinct objects $\{a_1, \ldots, a_m\}$, where each object $a_j$ is owned by exactly one person, and each person $p_i$ has a valuation function $v_i$ such that $v_i(a_j)$ is a non-negat...
I was given the following problem called the barter economy problem: Given a set of $n$ people $\{p_1, \ldots, p_n\}$ and a set of $m$ distinct objects $\{a_1, \ldots, a_m\}$, where each object $a_j$ is owned by exactly one person, and each person $p_i$ has a valuation function $v_i$ such that $v_i(a_j)$ is a non-negat...