instruction stringlengths 0 29.8k ⌀ |
|---|
What you are missing is that you need to consider all bits of size **3 or less**. That is: if in a compression scheme for bits of size 3 or less we compress one of the 3-bit strings to a 2-bit string, then some string **of size 3 or less** will have to expand to 4 bits.
A losless compression scheme is a function $C$... |
I just started reading a book called Introduction to Data Compression, by Guy E. Blelloch. On page one, he states:
> The truth is that if any one message is shortened by an algorithm, then some other message needs to be lengthened. You can verify this in practice by running GZIP on a GIF file. It is, in fact, possib... |
No compression algorithm can compress all input messages? |
|untagged| |
Just an additional note to Andrej's good answer:
You can also take a look to to [Komogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity):
**Definition**: Given a string $s$, its Kolmogorov complexity $C(s)$ relative to a fixed model of computation is the length of the shortes program (e.g. Turin... |
Summarizing the discussion, the intersection of two regular languages is always regular, and so "trivially decidable". |
null |
Just an additional note to Andrej's good answer:
You can also take a look to to [Komogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity):
**Definition**: Given a string $s$, its Kolmogorov complexity $C(s)$ relative to a fixed model of computation is the length of the shortes program (e.g. Turin... |
Just an additional note to Andrej's good answer:
You can also take a look to to [Komogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity):
**Definition**: Given a string $s$, its Kolmogorov complexity $C(s)$ relative to a fixed model of computation is the length of the shortes program (e.g. Turin... |
Just an additional note to Andrej's good answer:
You can also take a look to to [Komogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity):
**Definition**: Given a string $s$, its Kolmogorov complexity $C(s)$ relative to a fixed model of computation is the length of the shortes program (e.g. Turin... |
|data-compression|coding-theory| |
null |
I am unable to understand that what is characteristic path length (CPL) of a graph
In one of its definitions, it is written that " it is defined as the median of the means
of the shortest path lengths connecting each vertex to all other vertices."
Please elaborate it. |
Characteristic Path length |
|graphs| |
What you are missing is that you need to consider all bits of size **3 or less**. That is: if in a compression scheme for bits of size 3 or less we compress one of the 3-bit strings to a 2-bit string, then some string **of size 3 or less** will have to expand to 3 bits or more.
A losless compression scheme is a func... |
Let $d_G(x,y)$ be the distance between the vertices $x,y \in V(G)$ for a connected graph $G.$ The characteristic path length is then defined as $$\frac{\sum_{x \ne y} d_G(x,y)}{ {n \choose 2}} = \frac{\sum_{v \in V(G)} \sum_{u \in V(G) \setminus \{v\}} d_G(x,y)} { {n \choose 2}}$$ where $n$ is the number of vertices in... |
null |
{"Voters":[{"Id":3092,"DisplayName":"Jernej"}]} |
{"Voters":[{"Id":3092,"DisplayName":"Jernej"}]} |
Let $d_G(x,y)$ be the distance between the vertices $x,y \in V(G)$ for a connected graph $G.$ The characteristic path length is then defined as $$\frac{\sum_{x,y \in V(G)} d_G(x,y)}{n(n-1)} = \frac{\sum_{v \in V(G)} \sum_{u \in V(G) \setminus \{v\}} d_G(x,y)} { {n \choose 2}}$$ where $n$ is the number of vertices in $G... |
[Sutton's book on reinforcement learning](http://webdocs.cs.ualberta.ca/~sutton/book/ebook/the-book.html) explains it but probably in more detail than what you're looking for, so I'll try to explain it more briefly and clearly.
Start by thinking about the last position before the end of the game. The winning player ... |
I am unable to understand that what is characteristic path length (CPL) of a graph
In one of its definitions, it is written that " it is defined as the median of the means
of the shortest path lengths connecting each vertex to all other vertices."
Please elaborate it.
Can anyone tell me, Is this right what ... |
To get the CPL by this definition you first take the average distance from a certain vertex to any other vertex:
$$d_v = {{\sum_{v \ne w} d(v,w)} \over {|V(G)| - 1}}$$
After doing so for every vertex $v \in V(G)$, calculate the [median][1] of all previously calculated $d_v$.
[1]: http://en.wikipedia.org/w... |
Just an additional note to Andrej's good answer:
You can also take a look to to [Kolmogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity):
**Definition**: Given a string $s$, its Kolmogorov complexity $C(s)$ relative to a fixed model of computation is the length of the shortes program (e.g. Turi... |
Just an additional note to Andrej's good answer:
You can also take a look to to [Kolmogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity):
**Definition**: Given a string $s$, its Kolmogorov complexity $C(s)$ relative to a fixed model of computation is the length of the shortes program (e.g. Turi... |
null |
*3. There are algorithms which run in polynomial time in the Turing machine model, but not in the arithmetic model. The Euclidean algorithm for computing the greatest common divisor of two integers is one example.*
The Euclidean GCD algorithm runs in time polynomial in the number of bits of the input under both Turi... |
*3. There are algorithms which run in polynomial time in the Turing machine model, but not in the arithmetic model. The Euclidean algorithm for computing the greatest common divisor of two integers is one example.*
The Euclidean GCD algorithm runs in time polynomial in the number of bits of the input under both Turi... |
null |
this grammar is equivalent with
$$
\begin{align}
S \rightarrow &0A1B\mid 1B \\
A \rightarrow & 0A \mid \varepsilon \\
B \rightarrow & 0B \mid 1B \mid \varepsilon \\
\end{align}
$$
and so it is a simple grammar.
p.s. any simple grammar is unambiguous. |
I am unable to understand that what the characteristic path length (CPL) of a graph is.
In one of its definitions, it is written that
> it is defined as the median of the means
of the shortest path lengths connecting each vertex to all other vertices.
This is what I understand. Is it right?
Suppose we have... |
Characteristic path length |
null |
*3. There are algorithms which run in polynomial time in the Turing machine model, but not in the arithmetic model. The Euclidean algorithm for computing the greatest common divisor of two integers is one example.*
The issue in the above question lies in the definition of the *running time* that we are trying to bo... |
*3. There are algorithms which run in polynomial time in the Turing machine model, but not in the arithmetic model. The Euclidean algorithm for computing the greatest common divisor of two integers is one example. If an algorithm runs in polynomial time in the Turing machine, will it run in polynomial time in the arith... |
*3. There are algorithms which run in polynomial time in the Turing machine model, but not in the arithmetic model. The Euclidean algorithm for computing the greatest common divisor of two integers is one example. If an algorithm runs in polynomial time in the Turing machine, will it run in polynomial time in the arith... |
null |
Your counterexample is wrong.
Your list of compressed values has some hidden information which indeed makes the average length longer than 3 bits. The extra information is the length of the output string.
With our eyes we can see from your table that the first output string is only 1 bit long, and the others are... |
Your counterexample is wrong.
Your list of compressed values has some hidden information which indeed makes the average length longer than 3 bits. The extra information is the length of the output string.
With our eyes we can see from your table that the first output string is only 1 bit long, and the others are... |
Before formal definitions, consider what the "strongly/weakly" classification aims to distinguish.
First, consider running either one on a Turing Machine. Both will run in a number of steps polynomial in the length of binary-encoded input. Consequently, the number of arithmetic operations performed by both would hav... |
Before formal definitions, consider what the "strongly/weakly" classification aims to distinguish.
First, consider running either one on a Turing Machine. Both will run in a number of steps polynomial in the length of binary-encoded input. Consequently, the number of arithmetic operations performed by both would hav... |
In [1] *strongly-polynomial* is defined as either:
* The algorithm runs in strongly polynomial time if the algorithm is a polynmomial space algorithm and performs a number of elementary arithmetic operations which is bounded by a polynomial in the number of input numbers.
* A polynomial algorithm is a polynomial sp... |
Are there strongly-polynomial algorithms that take more than polynomial time? |
|complexity-theory|time-complexity|space-complexity| |
Before formal definitions, consider what the "strongly/weakly" classification aims to distinguish.
First, consider running either one on a Turing Machine. Both will run in a number of steps polynomial in the length of binary-encoded input. Consequently, the number of arithmetic operations performed by both would hav... |
null |
Given following grammar:
$$
\begin{align}
S \rightarrow &A1B \\
A \rightarrow & 0A \mid \varepsilon \\
B \rightarrow & 0B \mid 1B \mid \varepsilon \\
\end{align}
$$
How can I show that this grammar is unambiguous? I need to find a grammar for the same language that is ambiguous, and demonstrate it.
I kno... |
null |
|formal-languages|formal-grammars|context-free|proof-techniques|ambiguity| |
null |
null |
No, any strongly-polynomial time algorithm can be converted into a polynomial time algorithm on a TM. That is the whole point of strongly-polynomial vs weakly-polynomial.
When you've analysed algorithms in the past, you've probably assumed that your arithmetic operations (addition, multiplication, etc.) take unit ti... |
No, any strongly-polynomial time algorithm can be converted into a polynomial time algorithm on a TM by replacing the arithmetic operations with equivalent algorithms in the TM model. That is the whole point of strongly-polynomial vs weakly-polynomial.
When you've analysed algorithms in the past, you've probably ass... |
null |
null |
null |
I have a question about the stable marriage algorithm, for what I know it can only be used when I have arrays with the same number of elements for building the preference and the ranking matrices.
For example if we have 10 students that should be assigned to 10 dorms, then I can build the preference and ranking matr... |
stable marriage algorithm with asymmetric arrays |
|algorithms|graphs| |
You can add $5$ dummy students, and put them low in the dorms' preference order. The resulting perfect matching $\pi$ will have the following two properties:
1. There is no student $s$ and dorm $d$ which are *not* matched such that $s$ prefers $d$ to $\pi(s)$ and $d$ prefers $s$ to $\pi(d)$.
1. There is no student ... |
Yes, the stable marriage problem still makes sense with unequal arrays. Permit me to use men and women as opposed to students and dorms. There are different stable matchings that you can ask for resulting in different cases.
- A specific stable matching is desired, either male optimal or female optimal solution
... |
null |
If you know that <i>ε</i> is a rational number, then you do not need inapproximability for Max-2-SAT to prove your statement. A typical proof of the NP-hardness of Max-2-SAT (e.g., the one in the textbook _Computational Complexity_ by Papadimitriou) actually proves the NP-completeness of <i>L</i><sub>1/5</sub>. To pr... |
If you know that <i>ε</i> is a rational number, then you do not need inapproximability for Max-2-SAT to prove your statement. A typical proof of the NP-hardness of Max-2-SAT (e.g., the one in the textbook _Computational Complexity_ by Papadimitriou) actually proves the NP-completeness of <i>L</i><sub>1/5</sub>. To pr... |
null |
I wrote a function to check equality between integers `a` and `b` using bitwise shift operators. Return value of `1` means both are Equal and `0` means unequal inputs.
int foo(int a, int b)
{
return ((a>>= b<<= a) ? 1 : 0);
}
How can I prove theoretically that function `foo()` works for... |
Prove given equality check function works for all subset of integers |
|complexity-theory|algorithms| |
An alternative way to look at the problem is to ask what is the complexity of checking if a given list of numbers is sorted. Then by an adversary argument it can be shown that you have to access all of the numbers and therefore the time complexity (also query complexity) of the algorithm needs to be $\Omega(n)$.
Thi... |
The question here is that in the certificate definition of $\mathsf{NP}$, what is more important is the size of the certificate (in the size of the input), the complexity class that the certificate verifier belongs too is less important. In fact you can take the verifier to be in $\mathsf{AC^0}$ as long as the size of... |
|complexity-theory|nondeterminism| |
You don't need to give a reduction to show that the language is r.e., you can simply give an algorithm that will recognize the language.
Given $\langle M \rangle$:
0. Check if $M$ is a TM, if it is not reject,
1. Run $M$ in parallel on all strings using dove-tailing,
2. As soon as two branches halt, halt a... |
null |
You don't need to give a reduction to show that the language is r.e., you can simply give an algorithm that will recognize the language.
Given $\langle M \rangle$:
0. Check if $M$ is a TM, if it is not reject,
1. Run $M$ in parallel on all strings using dove-tailing,
2. As soon as two branches halt and acc... |
The decision tree method for proving lower-bounds (like the $\Omega(n \lg n)$ lower-bound for comparison based sorting you mentioned) are often called information theory methods.
Here is a short video by [Faith Ellen][1] about this method:
* [Lower-bounds, Part 2/4: Information Theory](http://www.youtube.com/wat... |
|algorithms|compilers|parsers| |
|operating-systems|concurrency|synchronization|concurrent-algorithms| |
As pointed by Yuval and cody there are easy solutions to get infinitely many Diophantine equations that are not provable nor refutable (let's say in PA).
However these syntactic solution result in provably equivalent sets, i.e. sets that the theory can prove they are equivalent. You can consider these as padding arg... |
|algorithms|partitions| |
|algorithms|graphs|shortest-path|linear-programming| |
The idea here is that we can't compute the output of the first algorithm completely because it can take more than logarithmic space (it can be polynomially large). But we don't need to if we are intelligent. What we can do is simulate the second algorithm and produce the bits it needs from the output of the first algor... |
The running time of the function on an input $n$ can be expressed as: $$T(n) = T(\sqrt n) + \mathcal{O}(1)$$
which implies the running time of the function and the number of recursions differ only by a constant.
The recursive chain ends when $n$ has been reduced to some value $k$, where $k \le 2$. The number of r... |
I'm trying to understand a formalization of the shortest path algorithm to a linear programming problem:
For a graph $G=(E,V)$, we defined $F(v)=\{e \in E \mid t(e)=v \}$ and $B(v)=\{ e \in E \mid h(e)=v\}$ where $t(e)$ is a tail of a node, and $h(e)$ is a head of a node.
Also the solutions for the conditions f... |
Formalization of the shortest path algorithm to a linear program |
Just hearing the question makes me think of two aspects:
- **Why class of automata from Regular Language(RL) is called finite automata.**
The class of automata for Regular Language(RL) is Finite Automata(FA). The automata is called finite because of finite memory available in term of states. So can construc... |
Choose the root so that it is a balanced tree. Put the parents of the leaves into the dominating set, do the same for the nodes of every other level. |
I had an interview today, and the interviewer has told me about a theorem (of someone called Hill- or Hell-something) which states that for a non-deterministic algorithm there exists a deterministic algorithm of some time complexity and a space complexity of no more than the original space complexity times log(n).
I... |
Logarithmic space difference between deterministic and non-deterministic algorithms |
|algorithms|space-complexity|nondeterminism| |
|complexity-theory|satisfiability|approximation| |
|algorithms|scheduling| |
Please help me calculate the time complexity of the following program.
int fun (int n) {
if (n <= 2)
return 1;
else
return fun(sqrt(n)) + n;
}
Please explain.
There were four choices given.
1. $\Theta(n^2)$
2. $\Theta(n \log n)$
3. $\Theta(\log n)$
4. $\Theta(\log \... |
null |
I'm trying to understand a formalization of the shortest path algorithm to a linear programming problem:
For a graph $G=(E,V)$, we defined $F(v)=\{e \in E \mid t(e)=v \}$ and $B(v)=\{ e \in E \mid h(e)=v\}$ where $t(e)$ is a tail of a node, and $h(e)$ is a head of a node.
Also the solutions for the conditions f... |
null |
null |
$S \rightarrow S$, $L(G) = \{\}$
**LL(1) analysis:**
We estabilish $FIRST(S)$ to be empty and $FOLLOW(S)$ to be $\{\$\}$,
which leads to this parse table:
+---+---+
| | $ |
+---+---+
| S | |
+---+---+
which correctly rejects any input including ε.
**LR(1) analysis:**
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.