instruction
stringlengths
0
29.8k
⌀
|computer-architecture|
null
I want to prove that $E \subsetneq EXP$ and i would like to do so using the Time Hierarchy Theorem $TIME(f(n)) \subsetneq TIME(n²\cdot (fn)²)$ I need to choose $f(n)$, i think $2^{cn}$ is a good choice, so here is my Proof: - $E\subseteq TIME(2^{cn})$ - $TIME(2^{cn}) \subsetneq TIME(n^2 \cdot (2^{cn})^2)$ Time...
How to Prove E $\subsetneq$ EXP
|complexity-theory|time-complexity|complexity-classes|
I want to prove that $E \subsetneq EXP$ and i would like to do so using the Time Hierarchy Theorem I need to choose $f(n)$, i think $2^{cn}$ is a good choice, so here is my Proof: - $E\subseteq TIME(2^{cn})$ - $TIME(2^{cn}) \subsetneq TIME(n^2 \cdot (2^{cn})^2)$ Time Hierarchy Theorem - $E \subsetneq EXP$ ...
How to Prove E $\subsetneq$ EXP?
I am looking for a way to implement division in modular arithmetics using modulo prime. The method I found in math books is to **try** $u$ such that $au \equiv 1 (\textrm{mod}\ p)$ $b/a \equiv bu (\textrm{mod}\ p)$ where $a, b, u \in Z_p$ (remainder class of mod p) and $p$ is a prime number. But trying thin...
Dividing in modulo prime arithmetics
|arithmetic|
To divide $b$ by $a$, you follow two steps: first you find $u$ such that $au \equiv 1 \pmod{p}$, and then you compute $bu \pmod{p}$. To find $u$, you run the extended GCD algorithm on $a$ and $p$. If it is indeed the case that $a \not\equiv 0 \pmod{p}$, then since $p$ is prime $(a,p) = 1$. So the GCD algorithm will com...
Is there any kind of CPU which doesn't contain an ALU ?
Does any CPU not contain an ALU?
I want to prove that $E \subsetneq EXP$ and i would like to do so using the Time Hierarchy Theorem I need to choose $f(n)$, i think $2^{cn}$ is a good choice, so here is my Proof: - $E\subseteq TIME(2^{cn})$ - $TIME(2^{cn}) \subsetneq TIME(n^2 \cdot (2^{cn})^2)$ Time Hierarchy Theorem - $E \subsetneq EXP$ ...
I want to prove that $E \subsetneq EXP$ and i would like to do so using the Time Hierarchy Theorem I need to choose $f(n)$, i think $2^{cn}$ is a good choice, so here is my Proof: - $E\subseteq TIME(2^{cn})$ - $TIME(2^{cn}) \subsetneq TIME(n^2 \cdot (2^{cn})^2)$ Time Hierarchy Theorem - $E \subsetneq EXP$ ...
null
The goal is to distribute approximately 100 million variable length strings, average length 100 characters, uniformly among 100 million buckets. Perfection not required, just no egregious clumping. The strings are URLs. They tend to begin much the same way and end much the same way (e.g. h t t p:// or w w w. and ".c o...
hashing algorithm for millions of variable length strings
|algorithms|hash|
null
null
Let $p$ be the $\gcd$ of the lengths of all the words in $L$. We claim that there exists $N$ such that for all $n>N$, $1^n\in L$ iff $p|n$. Observe that one direction is trivial: $p|n$ for every $1^n\in L$ by definition. The converse is less trivial, you can find good guidelines in the answers [here](http://math...
An exercise asks me to show that the Kleene star of any unary language L is regular. E is the alphabet, E = { 1 } Here's my reasoning : - L is regular -> L* is regular (closure property) - L is not regular - L contains the word of length 1 -> L* = E* U (empty word) -> L* is regular (since E* is regular, and...
Show that the kleene star of any unary language is regular
|untagged|
null
I am struggling with a homework assignment. This next question seems to be pretty easy, once I get what I feel like I'm missing now. Anyway, here goes: > Decide if the following language is regular or not and prove your > claim. > > $$L=\{a^{i_{1}}ba^{i_{2}}ba^{i_{3}}ba^{i_{4}}ba^{i_{5}}ba^{i_{6}}ba^{i_{7}}b|...
Deciding whether a given language is regular
|untagged|
null
I wrote the following LL(1) grammar to describe the set of boolean expressions involving `AND` ,`OR` an `NOT` only. This, as can be seen, also reflects the precedence of the operators (ie., 'AND' is done before 'OR', etc). Is it correct? 1. E ::= T E’ 2. E’ ::= OR T E’ 3. E’ ::...
grammar for describing boolean expressions with AND, OR and NOT
|formal-grammars|context-free|
|regular-languages|untagged|
Hint: Consider how many words are in $L$. The answer will then be immediate.
I am looking for a way to implement division in modular arithmetic using modulo prime. The method I found in math books is to **try** $u$ such that $au \equiv 1 \pmod{p}$ $b/a \equiv bu \pmod{p}$ where $a, b, u \in Z_p$ (remainder class of mod p) and $p$ is a prime number. But trying things isn't probably a...
Dividing in modulo prime arithmetic
The time hierarchy theorem states that if $f(n)$ is a reasonable function (technically, *time-constructible*), then there are some languages computable in time $f(n)$ that require (almost) time $f(n)$. More accurately, for any $g(n)$ satisfying $$ \frac{g(n)\log f(n)}{f(n)} \longrightarrow 0, $$ there is a function co...
A binary indexed tree has very less or relatively no literature as compared to other data structures. The only place where it is taught is [the topcoder tutorial][1]. Although the tutorial is complete in all the explanations, I cannot understand the intuition behind such a tree? How was it invented? What is the actual ...
null
null
|formal-languages|regular-languages|
I am struggling with a homework assignment. This next question seems to be pretty easy, once I get what I feel like I'm missing now. Anyway, here goes: > Decide if the following language is regular or not and prove your > claim. > > $$L=\{a^{i_{1}}ba^{i_{2}}ba^{i_{3}}ba^{i_{4}}ba^{i_{5}}ba^{i_{6}}ba^{i_{7}}b|...
|formal-languages|regular-languages|
How would I solve the following can anyone help me.I know MIPS is basically how many instruction the processor can do per second but what should I do? Assume that we are receiving a message across a network using a modem with a rate of 56,000 bits/second. Furthermore assume that we are working on a workstation wit...
Network modem question
|formal-languages|
Hint: Suppose that the processor manages to execute $N$ instructions between the receipt of each individual bit. Executing the $N$ instructions takes time $T_1$. The time interval between the receipt of each individual bit is $T_2$. Set up an inequality and solve for $N$.
|arithmetic|
null
Does the difficulty of a strongly NP-hard or NP-complete problem (as e.g. defined here http://en.wikipedia.org/wiki/Strongly_NP-complete) change when its input is unary instead of binary encoded? What difference does it make if the input of a strongly NP-hard problem is unary encoded? I mean, if I take for instance ...
Does the complexity of strongly NP-hard or -complete problems change when their input is unary encoded?
|complexity-theory|time-complexity|np-complete|
A problem size of $N$ encoded in unary is size $N$ and $\log N$ if binary. If the time taken is $F(N)$, this is $F(\text{size})$ in the first case and $F(2^{\text{size}})$ in the second case. So an algorithm that is polynomial for the first case will probably be exponential for the second. The encoding of the problem c...
The short answer is, that if the input is unary encoded, then it is *longer*. It is *exponentially* longer. Now, an algorithm that works in polynomial time **in the size of the input** has "enough time" to solve the problem, just because the input itself is exponentially longer than in the original problem.
Any string hashing algorithm designed for ASCII text should work fine. Take a look at the [Wikipedia article][1], consider if the set could be manipulated by an adversary to create pile-ups ([algoritmic vulnerabilities][2]). If that isn't an issue, at [strchr][3] and [partow][4] several "classical" hash algorithms are ...
Hashing algorithm for millions of variable length strings (URLs)
I have implemented Gaussian elimination for solving system of linear equations in the field of modulo prime remainders. If there is a pivot equal to zero I assume the system has no solution but how to calculate number of solutions of such systems when all pivots are non-zero? (i.e. one and more solutions)
Counting solutions to system of linear equations modulo prime
|linear-programming|
If the CPU (Central Processing Unit) does any processing, it will do either Arithmetic or Logic operations... in a sense, _some_ form of ALU is the core of the CPU.
The integers modulo a prime form a field, so all assumptions done applying Gaussian eliminations work exactly the same. Luckily, there are no numerical instability problems. The system can be inconsistent (no solutions), underdetermined (several solutions modulo $p$) or have a unique solution modulo $p$.
An exercise asks me to show that the Kleene star of any unary language $L$ is regular. $E$ is the alphabet, $E = \{ 1 \}$ Here's my reasoning : - $L$ is regular $\implies$ $L^*$ is regular (closure property) - $L$ is not regular - $L$ contains the word of length 1 $\implies$ $L^* = E^* \cup \{\epsilon\}$ $\...
Show that the Kleene star of any unary language is regular
null
No. --- If you change the encoding of the input, you've changed the formal definition of the problem, which means it's a **different problem**. The complexity of the original problem doesn't change, for the same reason that pointing at a different light in the sky does not change the mass of the moon.
> **Does a D&C algorithm have to have O(nlogn) complexity and divide the problem in half every time?** No. --- Consider Karatsuba's multiplication algorithm. Given two $n$-bit integers $x$ and $y$, the algorithm multiplies them as follows: a = x >> n/2; b = x - (a << n/2); c = y >> n/2; d...
The time hierarchy theorem states that if $f(n)$ is a reasonable function (technically, *time-constructible*), then there are some languages computable in time $f(n)$ that require (almost) time $f(n)$. More accurately, for any $g(n)$ satisfying $$ \frac{g(n)\log f(n)}{f(n)} \longrightarrow 0, $$ there is a function co...
null
How is Perfect shuffle a better interconnect scheme for parallel processing? For example if we consider a problem of sum reduction, I want to understand how this scheme is useful when implementing sum reduction in parallel , for example on a GPU?
Perfect shuffle in parallel processing
|computer-architecture|parallel-computing|
An undirected graph is a near clique if adding an additional edge would make it a clique. Formally, a graph $G = (V,E)$ contains a near clique of size $k$ where $k$ is a positive integer in $G$ if there exists $S \subseteq V$ where $|S| = k$ and $u,v \in S$ where $\{u,v\} \not\in E$, and $S$ forms a clique in $(V,E \cu...
Prove finding a near clique is NP-complete
|graphs|np-complete|
Does the difficulty of a strongly NP-hard or NP-complete problem (as e.g. defined here http://en.wikipedia.org/wiki/Strongly_NP-complete) change when its input is unary instead of binary encoded? What difference does it make if the input of a strongly NP-hard problem is unary encoded? I mean, if I take for instance ...
{"OriginalQuestionIds":[10013],"Voters":[{"Id":157,"DisplayName":"Ran G."},{"Id":41,"DisplayName":"Kaveh"},{"Id":6447,"DisplayName":"vonbrand"},{"Id":72,"DisplayName":"JeffE"},{"Id":3011,"DisplayName":"Paresh"}]}
null
Plot the intervals for all the jobs (sorted by earliest finishing time) on the x axis. Start with y = 1. If two jobs overlap, then plot the intervals of the later job on a higher y -- i.e., above the already plotted job interval. Stop when all jobs have had their intervals plotted. Now, start at the lowest botto...
Is there a sequence of undirected graphs $\{C_n\}_{n\in \mathbb N}$, where each $C_n$ has exactly $n$ vertices and the problem > Given $n$ and a graph $G$, is $C_n$ a subgraph of $G$? is known to be in class $\mathsf{P}$?
Can subgraph isomorphism be easy?
|complexity-theory|graphs|
I was reading the proof of pumping lemma from Sipsers book. I couldn't understand certain things mentioned there. Hope somebody could help me. ![pumping lemma proof][1] In the second paragraph he has written, "because $r_l$ occurs among first $p+1$ places, we have $l \le p+1$". Here $l$ denotes the number of stat...
Pumping Lemma for regualr languages proof doubt - Sipser Book
|computability|regular-languages|automata|pumping-lemma|
Is there a sequence of undirected graphs $\{C_n\}_{n\in \mathbb N}$, where each $C_n$ has exactly $n$ vertices and the problem > Given $n$ and a graph $G$, is $C_n$ an induced subgraph of $G$? is known to be in class $\mathsf{P}$?
Can induced subgraph isomorphism be easy?
You missed what $j$ and $l$ are. Read the paragraph again. They are the two indices of the same state in the list of visited states. For example if some automata goes from $s_1$ to $s_3$ to $s_5$ to $s_3$ to $s_7$, then you could pick $j = 2$ and $l = 4$, because both $2$nd and $4$th elements in the sequence are $s_3$...
You missed what $j$ and $l$ are. Read the paragraph again. They are the two indices of the same state in the list of visited states. For example if some automata goes from $s_1$ to $s_3$ to $s_5$ to $s_3$ to $s_7$, then you could pick $j = 2$ and $l = 4$, because both $2$nd and $4$th elements in the sequence are $s_3$...
While the answer of Yuval Filmus is absolutely correct, the comments and the correct proof for P in the question indicate that the problem of the OP is finding the intermediate class $\mathcal{C}$ between $\mathsf{E}$ and $\mathsf{EXP}$ ($\mathsf{E} \subseteq \mathcal{C}\subsetneq \mathsf{EXP}$). As Yuval Filmu als...
You missed what $j$ and $l$ are. Read the paragraph again. They are the two indices of the same state in the list of visited states. For example if some automata goes from $s_1$ to $s_3$ to $s_5$ to $s_3$ to $s_7$, then you could pick $j = 2$ and $l = 4$, because both $2$nd and $4$th elements in the sequence are $s_3$...
I was reading the proof of pumping lemma from Sipser's book. I couldn't understand certain things mentioned there. ![pumping lemma proof][1] In the second paragraph he has written, "because $r_l$ occurs among first $p+1$ places, we have $l \le p+1$". Here, does $l$ denotes the number of states visited? Also he...
Pumping Lemma for regular languages proof doubt - Sipser Book
null
An undirected graph is a near clique if adding an additional edge would make it a clique. Formally, a graph $G = (V,E)$ contains a near clique of size $k$ where $k$ is a positive integer in $G$ if there exists $S \subseteq V$ where $|S| = k$ and $u,v \in S$ where $(u,v) \not\in E$, and $S$ forms a clique in $(V,E \cup ...
The perfect shuffle alone has never been used as an interconnection network; it always included exchange links, in order to allow for a worst-case $O(\lg n)$ routing algorithm. Algorithms for reduction, broadcast, parallel prefix, transpose etc are given in Yosi Ben-Asher , David Egozi , Assaf Schuster, [SIMD Alg...
The perfect shuffle alone has never been used as an interconnection network; it always included exchange links, in order to allow for a worst-case $O(\lg n)$ routing algorithm. Algorithms for reduction, broadcast, parallel prefix, transpose etc are given in Yosi Ben-Asher , David Egozi , Assaf Schuster, [SIMD Alg...
I think the following reduction works (unless I missed something): Given $G=(V,E)$ and $k$, output $G'$ which is obtained from $G$ by adding $2$ new vertices $\{x,y\}$. that are each connected to all the vertices in $V$ (but not to each other). Finally, the output is to search for a $k+2$ near clique. Clearly thi...
I'm trying to figure out what are currently the two most efficent algorithms that permit, starting from a L/R pair of stereo images created using a traditional camera (so affected by some epipolar lines misalignment), to produce a pair of adjusted images plus their depth information by looking at their disparity. Ac...
Stereo images rectification and disparity: which algorithms?