instruction
stringlengths
0
29.8k
⌀
That syntax is actually rather questionable formally, since it treats the big-O as a function, which it is not. But with a bit of slop the rule to interpret these is rather simple. The big-O stands for some function with the asymptotic behaviour given by the big-O. I'll start with the full syntax of the big-O notati...
The state and transition functions have to be defined for all state and character combinations. Now if you say you can't get into the state, it means that if you do get there, the input was invalid. Therefore simply append a definition like "and all transitions not mentioned so far are to a rejecting state" (which is a...
The output and transition functions have to be defined for all state and character combinations. But if you say you can't get into the state, it means that if you do get there, the input was invalid. Therefore simply append a definition like "and all transitions not mentioned so far are to a rejecting state" (which is ...
null
We say that the language $J \subseteq \Sigma^{*}$ is *dense* if there exists a polynomial $p$ such that $$ |J^c \cap \Sigma^n| \leq p(n)$$ for all $n \in \mathbb{N}.$ In other words, for any given lenght $n$ there exist only polynomially many words of length $n$ that are not in $J.$ The problem I am currently studyi...
A dense NP complete language implies P=NP
|complexity-theory|time-complexity|np-complete|satisfiability|
The book *Elements of information theory* by Cover and Thomas contains some information on the Lempel-Ziv algorithm, including a proof of its asymptotic optimality (see Chapter 13).
I'm having a real hard time solving recurrences using the substitution method. Show that: $T(n) = T(n/2) + 1$ is $O(\lg n)$ I thought this to be relatively easy: We have to show that $T(n) \leq c \lg n$ Substitution gives me: $T(n) \leq c \lg(n/2) + 1$ = $c \lg n - c \lg 2 + 1$ = $c \lg n - ...
Solving a simple recurrence
|recurrence-relation|
For a language $L$ with pumping length $p$, and a string $s\in L$, the pumping lemmas are as follows: **Regular version**: If $|s| \geq p$, then $s$ can be written as $xyz$, satisfying the following conditions: 1. $|y|\geq 1$ 2. $|xy|\leq p$ 3. $ \forall i\geq 0: xy^iz\in L$ **Context-free version**: If $|...
Where do the length restrictions of the pumping lemma come from?
|formal-languages|regular-languages|context-free|pumping-lemma|
Suppose that I have a turing machine that receives as input the string $1^{n\times n}$ (unary input), what is the time complexity of writing $p_1,...,p_n$ on the output tape, where $p_i$ is the i-th prime number (written in binary)? And writing the first $n$ primes followed by their product (all written in binary)?
Writing the first n primes
|time-complexity|
The first condition, i.e. $|y| \geq 1$, is clearly necessary if you want to say something interesting: for $y = \varepsilon$, $xy^iz \in L$ *trivially* and always holds. The second condition, i.e. $|xy| \leq p$, is "arbitrary": the lemma still says something interesting if you drop it, and it is still true because t...
I'm having a real hard time solving recurrences using the substitution method. Show that: $T(n) = T(n/2) + 1$ is $O(\lg n)$ I thought this to be relatively easy: We have to show that $T(n) \leq c \lg n$ Substitution gives me: $\qquad \begin{align} T(n) &\leq c \lg(n/2) + 1 \\ &= c \lg n...
|reference-request|proof-techniques|recurrence-relation|
As you move through the states of an automaton, you'll eventually hit a cycle. The cycle is $y$. There is no point in pumping an empty word, hence condition 1. $xy$ is the number of symbols you had to read to find the first cycle. This can't possibly be more than the number of states, hence condition 2. Almost by defin...
Time complexity of generating the first n primes and their product
|time-complexity|turing-machines|
I'll only offer some pointers on the pumping lemma for regular languages; the reasoning is similar enough for the other. Think of $x$ as the part of $s$ generated by everything before starting the first loop for the first time; $y$ as everything generated while in that certain loop for the first loop; and $z$ as everyt...
I'm looking for an OCR technique (PCA or SVM or anything else) in a peculiar setting. I want to detect the motion of the finger so that if someone writes something in front of the camera in the air, I want to recognize the characters online (meaning as soon as they are written).
Handwritten character recognition as characters are being traced
|machine-learning|computer-vision|pattern-recognition|ocr|
[Optical character recognition](http://en.wikipedia.org/wiki/Optical_character_recognition) (OCR) is the conversion of images of printed or handwritten text to a machine textual representation.
Optical character recognition
asymptotic notations with two exponents
|formal-grammars|data-compression|lempel-ziv|
How optimal is Lempel-Ziv at reaching the Shannon limit?
|complexity-theory|combinatorics|data-compression|lempel-ziv|
I think you are looking for the topic of "**Algorithmic Information Theory**" (AIT). This area is the collision of information theory and computer science. For example "[Information and Randomness: An Algorithmic Perspective][1]" written by [cristian calude][2] contains interesting subjects in this area. You can find...
Operate on an image by performing Median Filtering in a 3x3 window.<br> Operate on the resulting image by performing, again, Median Filtering in a 3x3 window.<br> Can the resulting image be obtained from a single Median filtering? my initial thought is that it can be done with the right mask. maybe a median next t...
median filter one after the other
|image-processing|
Do there exist context-free grammars for the following two languages: (i) The set of all strings of the form `xx` where `x` is a sequence of `0`'s and `1`'s. (For instance `0110101101`.) (ii) The set of all strings of the form `xy` where `x` and `y` are sequences of `0`'s and `1`'s, `x` and `y` have the same leng...
Are these two languages context free?
|untagged|
null
Luckily i had 2 day ago the algorithm exam and so i was able to solve your question :-) When solving recurrences try first to use the Master method, if you can't succeed than try other methods. ![enter image description here][1] [1]: https://i.stack.imgur.com/NFQWY.jpg
Do there exist context-free grammars for the following two languages: (i) The set of all strings of the form $xx$ where $x$ is a sequence of $0$'s and $1$'s. (For instance $0110101101$.) (ii) The set of all strings of the form $xy$ where $x$ and $y$ are sequences of $0$'s and $1$'s, $x$ and $y$ have the same leng...
|context-free|
I designed a simulated annealing-based optimization algorithm. My simulation shows that it converge fast. I am looking for some sort of proof to show that simulation annealing-based algorithm converge fast (based on satisfying some properties) to global/local optimal point and doesn't oscillate in the optimal points (o...
Convergence of Simulated Annealing Based Algorithms
|algorithms|optimization|artificial-intelligence|
null
I am an electrical engineer, and only had one CS course in college 26 years ago. However, I am also a devoted Mathematica user. I have the sense that Turing Machines are very important in computer science. Is the importance only in the theory of computer science? If there are practical implications/applications what...
Practical importance of Turing machines?
|turing-machines|
The importance of Turing machines is twofold. First, Turing machines were one of the first (if not *the* first) theoretical models for computers, dating from 1948. Second, a lot of theoretical computer science has been developed with Turing machines in mind, and so a lot of the basic results are in the language of Turi...
This function works: **def hash(n): return ((0x0000FFFF & n)<<16) + ((0xFFFF0000 & n)>>16)** This is reversible, in that hash(hash(n)) = n, and has non-sequential pairs {n,m}, n < m, where hash(m) < hash(n). You can easily extend it to n-bits numbers. Ref: [Reversible hash function][1] [1]: http://st...
I'd like to know if there is a function $f$ from n-bit numbers to n-bit numbers that has the following characteristics: * $f$ should be bijective * Both $f$ and $f^{-1}$ should be calculable pretty fast * $f$ should return a number that has no significant correlation to its input. The rationale is this: I wa...
That syntax is actually rather questionable formally, since it treats the big-O as a function, which it is not. But with a bit of slop the rule to interpret these is rather simple. The big-O stands for some function with the asymptotic behaviour given by the big-O. I'll start with the full syntax of the big-O notati...
null
I reading a question from my recitation about optimal buffer size , at its solution there is a furmula for calculate optimal buffer size which I'm not sure about one of his parameters , descrabe as - $ Buffer_{optimal} = \frac{Buffer_{current}}{1-\frac{R_{app}}{R_{min}}}$ When - $ Buffer_{optimal} - \...
Optimal buffer size formula
|computer-networks|network-flow|
I reading a question from my recitation about optimal buffer size , at its solution there is a furmula for calculate optimal buffer size which I'm not sure about one of his parameters , describeas - $ Buffer_{optimal} = \frac{Buffer_{current}}{1-\frac{R_{app}}{R_{min}}}$ When - $ Buffer_{optimal} - \t...
I recently discovered that I have a fondness for the work of Dijkstra. I am currently reading random EWDs, and stumbled across one [with some notation that I couldn't quite grasp][1]. Dijkstra states that [ x < y => f.x.y < f.y.x ] OK, so. This isn't a list comprehension, right? Why the brackets? Also, how cou...
Understanding Dijkstra's notation "f.x.y"
|history|
The median is a value of a sample which states that half of the other values of the sample have higher values and the other ones are smaller ones. In a 3⨉3 filter you are selecting the median out of a sample of 8 elements. Let's assume we have the following values in our sample (an image of size 3⨉3): <pre>1 2 4 ...
Do there exist context-free grammars for the following two languages: 1. The set of all strings of the form $xx$ where $x$ is a sequence of $0$'s and $1$'s. (For instance $0110101101$.) 2. The set of all strings of the form $xy$ where $x$ and $y$ are sequences of $0$'s and $1$'s, $x$ and $y$ have the same lengt...
|formal-languages|context-free|
I think this would read: $$\forall x y. x < y \Rightarrow f(x,y) < f(y,x).$$ Read aloud: *for all x and y, x is less than y implies that f of x and y is less than f of y and x*. If you read the first sentence, it says that square brackets represent universal quantification over $x$ and $y$. The second states...
> **Possible Duplicate:** > [Show that $\{xy \mid |x| = |y|, x\neq y\}$ is context-free](http://cs.stackexchange.com/questions/307/show-that-xy-mid-x-y-x-neq-y-is-context-free) <!-- End of automatically inserted text --> Do there exist context-free grammars for the following two languages: 1. The set of all s...
{"OriginalQuestionIds":[307],"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
I think this would read as follows in modern notation (although field-local variations are possible): $$\forall x y. x < y \Rightarrow f(x,y) < f(y,x).$$ Read aloud: *for all x and y, x is less than y implies that f of x and y is less than f of y and x*. If you read the first sentence of the linked document...
null
The only reasonably practical application I can think of (in the sense that you might actually implement a Turing machine) is to prove that a language of some sort has sufficient power. If you're designing some kind of programming language (or anything else that is meant to compute things), then you may want to ens...
Just wondering if there exists such an Algorithm...It doesnt have to be implementable on a computer. By more efficient way I mean for example if S1 has O(n^2) (time or space) if there exists an S2 with O(n). Of course the output need only be yes/no and not S2 itself not even the complexity of an S2.
Existence of an algorithm to tell if for a given Problem P with a Solution S1, there exists a more efficient solution S2 to P?
|complexity-theory|undecidability|decision-problem|
On a PC I am implementing an algorithm in which a number from a look table will be chosen randomly, and will be multiplied by 1000 or 10000. Instead of multiplying by 1000 or 10000 I am thinking of simply padding the numbers with the required 0s. This padding will be nothing but some write operations (though random wri...
Which is more computationally efficient: multiplication or 0 padding?
|complexity-theory|
I'm assuming that your numbers are in binary. In this case, 0 padding is shift right: `x << 3` is the same as `x * 0x1000`. Shift right is much simpler to implement in hardware and is generally more efficient. You could check by writing a short C program.
I am wondering if there exists an algorithm to tell if for a given problem $P$ with a solution $S_1$, there exists a more efficient solution $S_2$ to $P$? It doesn't have to be implementable on a computer. By more efficient I mean for example if $S_1$ has $O(n^2)$ (time or space) if there exists an $S_2$ with $O(...
null
I'm assuming that your numbers are in binary. In this case, 0 padding is shift left: `x << 3` is the same as `x * 0b1000`. Shifting is much simpler to implement in hardware and is generally more efficient. You could check by writing a short C program. Note that there is one significant difference between shift l...
I'm assuming that your numbers are in binary. In this case, 0 padding is shift left: `x << 3` is the same as `x * 0x08`, where 0x08 (hex) is 1000 (binary). Shifting is much simpler to implement in hardware and is generally more efficient. You could check by writing a short C program. Note that there is one signif...
If 1000 and 10000 are constants, then any decent compiler will figure out the most efficient way to do the multiplication by itself. This is platform dependent. Any memory operation is most likely much more costly than multiplication (by orders of magnitude if the data is not in cache).
Could anyone answer this question Thank you
What are mechanisms preventing the process from taking over the processor forever?
|operating-systems|
null
|algorithms|reference-request|proof-techniques|optimization|
The technique is called preemptive multi tasking. See for example [this Wikipedia article](https://en.wikipedia.org/wiki/Preemption_%28computing%29). Basically the operating system runs every process for a short time, then suspends it and continues with the next process.
The [DEFLATE algorithm](http://en.wikipedia.org/wiki/DEFLATE) follows LZ77 with Huffman coding, and does better for finite strings than LZ77 alone. So LZ77 can be improved upon for finite strings fairly easily, just not by another iteration of LZ77. However, the Huffman algorithm doesn't use repeat patterns. If you're ...
I read a question from my recitation about optimal buffer size. As solution there is a furmula for calculating the optimal buffer size; I'm not sure about one of its parameters. The formula is $\quad \operatorname{Buffer}_{\text{optimal}} = \frac{\operatorname{Buffer}_{\text{current}}}{1-\frac{R_{\text{app}}}{R_{\m...
What is $R_\min$ in this formulat for optimal buffer size?
|computer-networks|
If you apply the LZ77 algorithm twice, it doesn't find any new repeat patterns the second time. You can show that if there were any repeat pattern present after the LZ77 algorithm has been applied. this would have arisen from a repeat pattern in the original data which LZ77 would have found. The [DEFLATE algorithm]...
Turing machines were one of the early models for computation, that is they were developed when computation itself was not understood very well (around 1940). I want to focus on two aspects that (arguably) led to them being the preferred model back then, which led to being the most established and therefore eventually s...
|terminology|history|
I recently discovered that I have a fondness for the work of Dijkstra. I am currently reading random EWDs, and stumbled across one [with some notation that I couldn't quite grasp][1]. Dijkstra states that $[ x < y \implies f.x.y < f.y.x]$ OK, so. This isn't a list comprehension, right? Why the brackets? Also, ...
Understanding Dijkstra's notation $f.x.y$