instruction
stringlengths
0
29.8k
⌀
null
There are a lot of work about bounds on the complementation of Streett automata (see e.g. [this paper][1]). They talk about the general setting of nondeterministic Streett automata. But what about deterministic ones? Streett automata are closed under determinisation although with an exponential blow-up. And compleme...
Complementation of deterministic Streett automata
|automata|omega-automata|
I am reading a proof of correctness for the MergeSort Algorithm. This is the code for the MergeSort and the Merge function: ![MergeSort code][1] The correctness of the MergeSort function is easy to prove since the two `MergeSort` recursive calls decrease the size of the problem by half, which guarantees the conve...
null
I am fitting different 2D geometric transformations by least-squares. For instance quadratic, $$\begin{cases}a'x^2+b'xy+c'y^2+d'x+e'y+f'=X\\a''x^2+b''xy+c''y^2+d''x+e''y+f''=Y\end{cases}$$ which is linear in the unknowns $a',b',\cdots f''$. I also solve homographic transformations $$\begin{cases}\dfrac{a...
null
I am fitting different 2D geometric transformations by least-squares. For instance quadratic, $$\begin{cases}a'x^2+b'xy+c'y^2+d'x+e'y+f'=X\\a''x^2+b''xy+c''y^2+d''x+e''y+f''=Y\end{cases}$$ which is linear in the unknowns $a',b',\cdots f''$. I also solve homographic transformations $$\begin{cases}\dfrac{a...
There are a lot of work about bounds on the complementation of Streett automata (see e.g. [this paper][1]). They talk about the general setting of nondeterministic Streett automata. But what about deterministic ones? Streett automata are closed under determinisation although with an exponential blow-up. And compleme...
[This paper](https://faculty.runi.ac.il/udiboker/files/RabinVsStreett.pdf) gives an example of a deterministic Rabin automaton with $\mathcal{O}(n)$ states such that there is no nondeterministic (hence no deterministic) equivalent Streett automaton with less than $2^n$ states. I guess there is no hope for a polynomi...
null
Just one part of the answer: You calculate a sequence and look for cycles. There are two well-known algorithms for cycle detections, Brent's and Floyd's. One calculates $x_{2k}$ and $x_k$ in parallel which will find cycles, the other tries to detect cycles of length ≤ 2, then length ≤ 4, then length ≤ 8, then length ≤ ...
There is a chess tournament planned. It is a single-elimination tournament, and for spectacle purposes, only one match at a time will take place, on a table in the middle of the stage (winners will have to move if they don't play the next match). Luckily, the organisers succeeded in inviting a grand chess champion t...
How to let the champion sit?
|algorithms|graphs|optimization|optimal-strategy|
null
I have an algorithm with running time that satisfies $$ T(n) \leq n + \frac{1}{n}\sum^{n-1}_{i=0}(T(i) + T(n-i)).$$ I was able to show that $T(n) = \mathcal O(n\log n)$ with a leading constant $c > 4$. I modified this algorithm such that the recursion for $T(n)$ now satisfies $$ T(n) \leq 3 \log n + n + \frac{3}{n...
Runtime of this algorithm
|algorithm-analysis|asymptotics|big-o-notation|
I am learning about context free languages. I understand how $\{a^nb^nc^n|n>0\}$ can be shown to be not context free using the pumping lemma for CFL's. Intuitively however it seems that a pushdown automata to recognize $\{a^nb^nc^n|n>0\}$ can be constructed. This PDA would initially push single a's into its stack...
null
null
There is a class exercise question asking about global sink in a directed graph. Finding normal sink is not difficult but the conditions of the question have made me stuck on this question. > Let $G=(V,E)$ be a directed graph for which you have an adjacency > list. A vertex $v$ is called a _global sink_ if and o...
Find a Global Sink in a DAG
null
Find a Global Sink in a graph
I am starting to learn online algorithms but am still stuck in determining the competitive ratio. I cannot understand how to find it. All the research papers are so difficult to understand. Please share a proper source from which I can start my journey.
How to find competitive ratio of any online algorithm?
|algorithms|online-algorithms|competitive-ratio|
You are not supplying the definition of $L$, so here is one definition which works: $$ L = \{ a b^n c^n : n \geq 0 \} \cup \{ a^k w : k \neq 1 \text{ and } w \in \Sigma^* \text{ doesn't start with $a$} \}. $$ Choose a pumping length of $3$. A word $ab^nc^n \in L$ can be pumped by pumping the $a$ part. A word $aab...
I have an oriented and weighted graph, and I need to find the cheapest route from source to destination. Now I have a source node A and a destination node B the cheapest path is given to me by the sum of the weight of the arches to which I have to subtract the discount, the discount is given to me by the weight of the...
is it possible to find all possible paths with dijkstra algorithm?
|algorithms|graphs|shortest-path|weighted-graphs|dijkstras-algorithm|
is it possible to solve this problem with dijkstra's algorithm?
Let $F(n)=a^n$. Then $$a^{n+2}=2a^n+a^{n+1}$$ so that $$a^2-2a-1=0$$ and $a=1\pm\sqrt2$. By the theory of linear recurrences, the general solution is of the form $$c_+(1+\sqrt2)^n+c_-(1-\sqrt2)^n.$$ The initial conditions tell us that $c_++c_-=0$ and $2\sqrt2 c_+=1$. Hence $$F(n)=\frac{(1+\sqrt...
{"Voters":[{"Id":16034,"DisplayName":"Yves Daoust"}]}
Let $F(n)=a^n$. Then $$a^{n+2}=2a^n+a^{n+1}$$ so that $$a^2-a-2=0$$ and $a=-1,2$. By the theory of linear recurrences, the general solution is of the form $$c_+2^n+c_-(-1)^n.$$ The initial conditions tell us that $c_++c_-=0$ and $3\,c_+=1$. Hence $$F(n)=\frac{2^n-(-1)^n}3.$$ Now plug $n=0,1,...
{"Voters":[{"Id":16034,"DisplayName":"Yves Daoust"}]}
A proof of $\mathsf{NP}$-completeness for a decision problem requires two things: - $\mathsf{NP}$ membership; - $\mathsf{NP}$-hardness. It is often the case that the $\mathsf{NP}$-hardness part is the most difficult to prove, and it is not rare that some paper completely omit the $\mathsf{NP}$ membership part....
A NP-complete problem with difficult NP membership proof
|np-complete|np|
Let $F(n)=a^n$ and assume that the recurrence also holds for $n=0$. Then $$a^{n+2}=2a^n+a^{n+1}$$ so that $$a^2-a-2=0$$ and $a=-1,2$. By the theory of linear recurrences, the general solution is of the form $$c_+2^n+c_-(-1)^n.$$ The initial conditions tell us that $c_++c_-=0$ and $3\,c_+=1$. Hence ...
Not that the distance is always > 0. The solution still doesn't require revisiting a node later, so Djikstra should be usable. Idea: the weight of a path is always going to be (sum of all edge weights of edges in the path) - (highest weight of edge in path) Djikstra guarantuees we always know the shortest path t...
$$F(0)=0,\\F(1)=1,\\F(3)=2F(1)+F(2)=F(2)+2\\F(4)=2F(2)+F(3)=3F(2)+2,\\F(5)=2F(3)+F(4)=5F(2)+6.$$
null
A proof of $\mathsf{NP}$-completeness for a decision problem requires two things: - $\mathsf{NP}$ membership; - $\mathsf{NP}$-hardness. It is often the case that the $\mathsf{NP}$-hardness part is the most difficult to prove, and it is not rare that some papers completely omit the $\mathsf{NP}$ membership part...
is it possible to solve this problem with Dijkstra's algorithm?
I trying to understand where as a programmer in situations where it can be good to do a NP-Complete reductions to prove that a problem is NP-Complete why it is good to do that as a Programmer i don't understand?
Why is proving something is NP-Complete is useful and where can i use it?
|np-complete|
When dealing with a problem, knowing how to recognize a $\mathsf{NP}$-hard problem can prevent you from hair loss trying to find an efficient solution (as it is thought that $\mathsf{P}\neq \mathsf{NP}$). Reductions can also be seen in a "If I know how to solve $A$, then I know how to solve $B$" way. When confron...
\begin{bmatrix} 1-\alpha & 3\alpha/4 & \alpha/4\\ \alpha/4 & 1-\alpha & 3\alpha/4\\ 3\alpha/4 & \alpha/4 & 1-\alpha\\ \end{bmatrix} I was told that the probability of error of this channel can not be $\alpha/4 $ or $3\alpha/4$. How do I know this? How can i find the probability of error?
Consider a ternary channel with the following channel matrix:
|information-theory|coding-theory|
Consider an input symbol $x$. The probability that the output symbol differs from $x$ is $\alpha$ (regardless of the choice of $x$). Therefore, regardless of the input distribution, the probability of error will be $\alpha$. As you see, you can have $\alpha = \alpha/4 = 3\alpha/4$ when $\alpha=0$.
null
I figured out that this problem is isomorphic to CNF-SAT where: - Each hyperedge $H = {v_1, v_2, ... v_n}$ corresponds to a clause $(v_1 \lor v_2 ... \lor v_n)$ - Each edge $(u, v)$ corresponds to the clause $(\neg u \lor \neg v)$ And a "war" between hyperedges corresponds to a particular form of resolution, wher...
Not that the distance is always > 0. The solution still doesn't require revisiting a node later, so Djikstra should be usable. Idea: the weight of a path is always going to be (sum of all edge weights of edges in the path) - (highest weight of edge in path) Djikstra guarantuees we always know the shortest path t...
It's possible to solve this using a common trick: rather than altering the algorithm, alter the graph. "Subtracting the weight of the largest edge" is the same as "setting the weight of the largest edge to 0". In other words, we want to find the shortest path where one edge is allowed to have weight 0. To solve t...
If a problem is NP-complete that means that lots and lots of great mathematicians, computer scientists, and very clever software developers have not been able to find an efficient solution for the problem. And that means nobody can blame you if you can't find one. If you could find one, they'd introduce a Nobel prize f...
What it means is: They have found an NP-complete problem that could be solved by creating a very cleverly designed "Battleship" instance of at most polynomial larger size, solving the "Battleship" instance and creating a solution for the original instance from that. It's really a guess, but I suppose they figured o...
See Appendix F.2.1. of Oded Goldreich's book here: https://www.wisdom.weizmann.ac.il/~oded/CC/r6.pdf
Examples like - swinging both of their hands - squat - walking around - jump around - etc Is it possible to perform this in real time under crowded scene without depth information? I can find out the "action level" if I knew what kind of action the person are doing, but can't find a fast solution to find o...
Is it possible to measure how fast the humans are moving their bodies with different level(slow, normal, fast) from video?
|algorithms|algorithm-analysis|computer-vision|
Knowing about NP-complete problems is part of the cultural baggage of every computer scientist, as is the case for other core results (such as the non-computability of the halting problem). NP-complete problems arise in practice. The maximal independent set problem for graphs is aimed at simultaneously exploiting a max...
I have tried to convert signed binary number, -11.875, to unsigned value. I am not sure about where to add the carry bit taking 2's complement of binary -11.875. The carry bit should be added with the decimal part or the RHS side of -11.875?
Signed Decimal Binary to Decimal conversion
|algorithms|
null
Sure. Use any method for detecting the pose of the person (or keypoints for their hands, arms, etc.) in every frame. Then, it is trivial to measure the "speed" of movement, in pixels per second: this is the distance between the two keypoint locations in two frames, divided by the time between the two frames. This me...
|algorithm-analysis|asymptotics|recurrence-relation|big-o-notation|
[![enter image description here][1]][1] [1]: https://i.stack.imgur.com/IRt4q.png What happens if Operand Fetch and Write Back happen in same cycle?
What happens in harvard architecture pipelining if cpu needs to write data and fetch data at the same time?
|computer-architecture|cpu|cpu-pipelines|
Start with $N>3$ vectors $\vec{v}_I$ in $\mathbb{R}^3_+$, any $3$ of which are linearly independent. $I$ here ranges from $0$ to $N-1$. Let $v_{\left[abc\right]}$ be a matrix in $\mathbb{R}^{3 \times 3}_+$ that picks three of the vectors $\vec{v}_a\, \vec{v}_b\, \vec{v}_c$ in order $a < b < c$, without duplication. ...
Efficiently finding/ sampling from all solutions to a constrained linear problem
|linear-programming|linear-algebra|constraint-satisfaction|
There is a chess tournament planned. It is a single-elimination tournament, and for spectacle purposes, only one match at a time will take place, on a table in the middle of the stage (winners will have to move if they don't play the next match). Luckily, the organisers succeeded in inviting a grand chess champion t...
Start with $N>3$ vectors $\vec{v}_I$ in $\mathbb{R}^3_+$, any $3$ of which are linearly independent. $I$ here ranges from $0$ to $N-1$. Let $v_{\left[abc\right]}$ be a matrix in $\mathbb{R}^{3 \times 3}_+$ that picks three of the vectors $\vec{v}_a\, \vec{v}_b\, \vec{v}_c$ in order $a < b < c$, without duplication. ...
I suggest you randomly sample 10,000 matrices $v_{[abc]}$. Keep only the ones where the resulting linear combination $w_{\left[abc\right]}$ meets your filtering constraints (e.g., is all positive). Average the ones kept. Output that as an estimate of the value you are seeking. This should be a pretty good estimat...
I am reading a proof of correctness for the MergeSort Algorithm. This is the code for the MergeSort and the Merge function: ![MergeSort code][1] The correctness of the MergeSort function is easy to prove since the two `MergeSort` recursive calls decrease the size of the problem by half, which guarantees the conve...
MergeSort's merge function loop invariant - Permutation
null
I am reading a proof of correctness for the MergeSort Algorithm. This is the code for the MergeSort and the Merge function: ![MergeSort code][1] The correctness of the MergeSort function is easy to prove since the two `MergeSort` recursive calls decrease the size of the problem by half, which guarantees the conve...
I am reading a proof of correctness for the MergeSort Algorithm. This is the code for the MergeSort and the Merge function: ![MergeSort code][1] The correctness of the MergeSort function is easy to prove since the two `MergeSort` recursive calls decrease the size of the problem by half, which guarantees the conve...
MergeSort's merge function loop invariant
I am reading a proof of correctness for the MergeSort Algorithm. This is the code for the MergeSort and the Merge function: ![MergeSort code][1] The correctness of the MergeSort function is easy to prove since the two `MergeSort` recursive calls decrease the size of the problem by half, which guarantees the conve...
I am reading a proof of correctness for the MergeSort Algorithm. This is the code for the MergeSort and the Merge function: ![MergeSort code][1] The correctness of the MergeSort function is easy to prove since the two `MergeSort` recursive calls decrease the size of the problem by half, which guarantees the conve...
I am reading a proof of correctness for the MergeSort Algorithm. This is the code for the MergeSort and the Merge function: ![MergeSort code][1] The correctness of the MergeSort function is easy to prove since the two `MergeSort` recursive calls decrease the size of the problem by half, which guarantees the conve...
Assuming a contiguous array implementation of a binary min heap with `n` elements, is it possible to remove the k-smallest elements in a faster time than $O(k \log n)$, as can be done via iteratively removing the minimum of the heap $k$ times? More formally, by removal of k smallest elements, I mean removing the k s...
To avoid contention(hazard) between the 2 stages, a [split cache][1] i.e. I-cache(instruction cache) and a D-cache(data cache). Consequently, Fetch and Writeback operations are handled by I and D cache respectively. [1]: https://en.wikipedia.org/wiki/Modified_Harvard_architecture#Split-cache_(or_almost-von-Neuma...
null
Use Dijkstra's algorithm to find shortest path where we can subtract the weight of the largest edge
null
subtract the weight of the largest edge
I have an oriented and weighted graph, and I need to find the cheapest route from source to destination. Now I have a source node A and a destination node B the cheapest path is given to me by the sum of the weight of the arches to which I have to subtract the discount, the discount is given to me by the weight of the...
I had a few questions about inverted page table that I don't understand and would appreciate some help please. For the inverted page table, since the number of entries in the inverted page table equal number of entries in the main memory, wouldn't that result in two problems... One, the page can't have disk as ph...
Question about Inverted Page Table?