instruction
stringlengths
35
11.4k
How do I solve the following problem with a recurrent neural network (RNN)? What architecture should I use for the (conv)-RNN? Let $s \in \mathbb{R}^N$ be a musical signal. We corrupt it with some white/pink noise $\omega$ to obtain $x= s+\omega$. We then create a conv-RNN with $N$ input and $N$ output neurons, we...
Okay so I've been going crazy about this problem I was given. It is as follows: Given a pile of N matches, 2 people take turns removing matches from the pile. When it is your turn you are allowed remove 1, 5 or 6 matches. If it is your turn and you are unable to make a move then the game is over and you have lost. The ...
I am curious because I took a quiz and answered false to the question: "The height of an AVL tree may be greater than the height of a binary heap with the same elements." I have been trying to think of an example, but I just cannot figure it out. Does anyone know when this is the case?
I'm attempting to solve the recurrence relation $$T_{(n)}=4T_{(n−1)}+(n+5) 3^n$$ with the conditions: $n>0$ $T(0)=0$ I know the solution must be in the form $$T_{(n)}=T_h+T_p $$ but I think I'm making a mistake since when I calculate $T_h$ it gives me 0, and also don't know how to guess the $F_{(n)} = (n+5)*3^n$ int t...
I am interested in knowing what algorithmic paradigm are the usual recursive sudoku solvers. Can I consider it a local search? or are they Dynamic programming, greedy, divide and conquer, backtracking?
Let we fix $<T>$ and $w$, where $<T>$ is its binary representation of a Turing machine and $w$ is input. We want to check if $T$ doesn't halt over $w$ before $2^{|w|}$ steps. A trivial solution is to use a universal Turing machine which simulates $T$ on $w$ and counts its steps, but this method uses exponential time. I...
Given the alphabet $\{ a,b \}$, if I want to build the regular expression for even/odd lenght strings, I can think that an even lenght string is given by some combination of $a$'s and $b$'s, and the letters can be paired, so there are four possibilities: $aa,ab,ba,bb$, the regular expression(for even lenght strings) so...
Let $\Sigma = \{0, 1\}$ and $$L = \{ w \in \Sigma^* | w = \mathrm{odd}(w) · \mathrm{even}(w) \},$$ where $\mathrm{odd}(w) = w_1, w_3, w_5 \ldots{}$ and $\mathrm{even}(w) = w_2, w_4, w_6, \ldots{}$ are the words constructed from the characters in all the odd and even positions of the string. I.e. $w = 0110110110 \in L...
From what I have read, instructions under x86 can be as long as 15 bytes. Since x86 is a 32-bit architecture (64-bit for x86-64 obviously) how does it handle these long instructions? How are they stored in memory, and how are they fetched?
I've been finding myself a bit confused with the direction of reductions used to show that certain languages are not recursive. For example, let us say we want to determine if the Halting Problem ($HALT_{TM}$)is undecidable. I know we can assume that it is decidable and then try to build a decider for the acceptance pr...
I'm currently reading Nancy Lynch book about distributed systems, chapter about IO automaton. And I have following questions related to book exercise 8.13(c). We are given some automaton A with sig(A) is empty. Traces(P) is the set of sequences over {1,2} in wich every occurance of 1 is immediatly followed by a 2. I ...
Let's assume we are to implement a Round-Robin algorithm. What will happen in a case when a process has completed it's time quantum at the same time as another process arrives. Let's say we have a time quantum of 3 CPU cycles and a process A's burst time is 5 CPU cycles. If it runs from 0 to 3 (in CPU cycle time), and ...
Find a pushdown automaton accepting the language $$L=\{A^i B^j C^k \mid 2k \le i \le 3k \text{ or } j \neq i+k \}.$$ I can't construct the automaton because I can only imagine it with multiple stacks or with set-theoretic intersections.
The rule is that an isolated lit square in a grid of squares must be paired in the x-direction (either immed. left or right of it) AND y-direction. That is, from surrounding cells, the closest lit or on square moves to the isolated square to join it in the x or y-direction, and the isolated square moves to the one mov...
I had a question for my paper last week and i tried solving but failed. Given n people, any two are either friends or enemies, and friendship and enmity are mutual. I want to distribute hats to them, in such a way that any 2 friends possess a hat of the same color but no two enemies possess a hat of the same color. Eac...
I am of the understanding that tradition "simple" recurrent neural networks have the problem of "losing error" after a lot of time steps. But is this some kind of deficiency of the math, or the machines the RNN's are running on? If it's just the machines, couldn't you use something like an arbitrary precision float and...
I need to find true shortest path between two points. true means that shortest path can be laid both through the vertices, and through the edges. Input Set of triangles, given by coordinates of 3D-points. Source and target points. Output Sequence of 3D-points representing a true shortest path from source to target. ...
Had this question on an algorithm exam. Can any one explain why $\sqrt{n} = \Omega(3^{\log n})$ is false?
Given an arbitrary undirected graph $G = (V,E)$, I am interested in a low-polynomial time algorithm which can find several moderately large (ideally $O(n^\epsilon)$ vertices per clique for $\epsilon > 0$) cliques in $G$, provided they exist. I am aware that the problem of finding the maximal clique is NP-hard. For my p...
If a CNF contains both horn and dual horn clauses and does not contain clauses of other types, then can its Satisfiability always be determined in polynomial time? If the answer to the above problem is yes, then suppose we only add XOR clauses in addition to horn and dual horn clauses, can the Satisfiability of this ty...
I have heard of some people mentioning the general rule that says that you can only ever guarantee that a program will not capture the negative cases but you can never guarantee that it captures all the positive cases. I am only roughly summarizing what i heard and don't know the exact definition or exact phrase but t...
I want to figure out if the following language is Turing decidable, Turing acceptable but not turing decidable, or neither. The language is {ρ(M) : |L(M)| ≤ 10} My question for this problem is what does |L(M)| ≤ 10 mean? At first, I thought it meant that the language will only accept strings that are less than ...
I was just reading this paper: Gate-Variants of Gated Recurrent Unit (GRU) Neural Networks Rahul Dey and Fathi M. Salem It seems to me that perhaps the architecture of LSTMs and GRUs are overly complicated. And that the same problems could probably be solved with a simpler architecture. I get the theory behind LSTMs a...
What does happen if two events simultaneously occur at a particular state of a finite state automaton (FSA)? For example, assume that an FSA's event table at its state $s$ is as follows: $\delta(s,e_1)=s_1$ and $\delta(s,e_2)=s_2$. What will be the system's next state if both $e_1$ and $e_2$ occur exactly at the same t...
Let $S_1$ and $S_2$ are two multi sets. We want to find, Is $S_1 =S_2$? Algo 1: Sort $S_1$ and $S_2$ and then check $S_1 = S_2$ Running time : $O(n \log {n})$, where $n$ is the size of the multi sets. Algo 2: Contruct two polynomials using $S_1$ and $S_2$ (example if $S_1 = \{1,1,2\}$ then polynomial will be $(x-1)(x...
We are assigning the colours white/black to the vertices of a DAG, under the condition that if $V$ is black and there is a path $V \to W$ for some vertex $W$, then $W$ is black. Examples: In the case of a linear chain of $N$ nodes, the answer is $N+1$ - either all the nodes are white, or one of the N nodes is black me...
I want to prove regularity of a language that contains a known regular language $L$ using an NFA. Say the transition function of the automation that accepts $L$ is $f$. In my new transition function, is there a limitation on composition of $f$? For example, can I make the following transition in the new function? $$f'(...
I am searching for information on a variant of the 0-1 Knapsack Problem I will call the Vector Knapsack Problem (VKP), which is basically the same as the standard KP except that the values being summed are vectors (and them sum is the Euclidean norm of the sum of the vectors). Formally, given a set of $m$ vectors $v \i...
I am studying for an artificial inteligence class, and i have to classify the following sentence "For any search space, there is always an admissable and consistent A* heuristic". Well, i know that there is always an admissable heuristic, for example zero, since its an underestimation of the real cost (althoug this wou...
Taken from Artificial Intelligence A Modern Approach : Notice how a node doesn't gets added to the frontier twice in Graph-Search, And then take a look at this : Now obviously this is not true as in the following example : Bucharest will be added to the frontier first with path sibiu->fagaras->bucharest, while the s...
I have a Turing machine M. How can I prove that $L(M) = (L(M))^R$ is decidable by constructing a Turing machine that can do this? I know how to figure out if two DFA's accept the same language (using the symmetric difference) however I don't believe it works for Turing machines. Now I am able to design a Turing machine...
The "function" type $\rightarrow$ is predefined in Agda. But how would one define it if it was not predefined? Specifically I am talking about $\rightarrow$ in: data Nat : Set where zero : Nat Suc : Nat -> Nat
I have a weighted graph representing traffic network. Nodes represent the locations and vertices represent available paths between locations. Weight values represent number of the passages on the path. I would like to cluster based on the similarity of the weight values (i.e. number of passages) and establish different...
Given a matrix $M \in \mathbb{R}^{n \times m}$ and a set $S \subset \{1, \ldots, n\}$, let $M_{S, {\rm row}}$ be the matrix obtained by picking the rows of $M$ from the set $S$. Similarly, given $S' \subset \{1, \ldots, m\}$ we let $M_{S', {\rm col}}$ be the matrix obtained by picking the columns of $M$ in $S'$. Now ...
We are given an array with only $0$s and $1$s. The number of $0$s is greater or equal to the number of $1$s. The goal is to ensure that there is not a pair of $1$s adjacent to each other. We can only read the value of an element or to swap 2 elements. What is an algorithm for the fewest swaps possible? I tried swapping...
Given a list of logical formulas: f1: A&B f2: A&D&C f3: B&D&E f4: A&B&C f5: fn: ... In this case I want A&B as the longest formula which is common to at least two formulas. Is there a simple algorithm to find the longest formula that could be performed on paper?
I want to reconstruct a graph when given the results of a Floyd-Warshall shortest pair distances matrix, similar to the problem being solved in this question: Is it possible to reconstruct graph if we have given matrix of shortest pairs The only difference being that, whilst the problem from the linked-to question seek...
What are the rules pertaining to 3SAT as to the actual boolean equation? The main thing I do not understand is in a given boolean expression within a single clause can you have both AND + OR operators i.e. (x1 & x2 | x3) or do they have to remain consistent i.e. (x1 & x2 & x3) or (x1 | x2 | x3)? That being said when c...
According to the answer at (How to define function type in AGDA) the function type is kind of a fundamental thing in Agda and needed for bootstrapping, hence end user can not define it like what they do for conjunction(product) type and has to be predefined at the language level. Does this mean that implication(functio...
I am fairly confident that my textbook (Concepts of Programming Languages 11th edition, international edition, Robert Sebesta) has an error in its definition of what a phrase is in the section on bottom-up parsers. After an infuriating conversation with the professor using that textbook in which I was told that the boo...
Neural networks are the base for all(most?) of the machine learning / deep learning algorithms/programs. Humans don't have fixed algorithms to decide or do something. Initially, we don't know how a snake is supposed to look. We learn that from experience. But our learning is never perfect. Once in a while, we mistake a...
According to complexity zoo: Class UP (Unambiguous Polynomial-Time) is defined as: The class of decision problems solvable by an NP machine such that If the answer is “yes,” exactly one computation path accepts. If the answer is “no,” all computation paths reject. Class US (Unique Polynomial-Time) is defined as: Th...
Does $BPP^{NP}\subseteq\Sigma_k^P\cap P/poly^{NP}\subseteq BPP^{\oplus P}$ hold at some $3\leq k<\infty$? Also is $BPP^{BPP^{\oplus P}}\subseteq BPP^{\oplus P}$ known? Note Sipser gives $BPP\subseteq \Sigma_2P$ and Adleman gives $BPP\subseteq P/poly$ and so I am tempted to say $k=3$ in $1.$ works. I am not sure relat...
I did exercise problem from Pittsburgh university cs department. homework. Question 8 is somewhat exciting. Q8 is solved using greedy algorithm but I have no idea how to prove. Below is Question. Consider the following problem. The input consists of the lengths $l_1, \cdots, l_n, $ and access probabilities $p_1, \cdo...
I have a connected and undirected graph without cycles (i.e. a tree), and I am trying to find a single cut vertex that, when removed, disconnects the graph into a set of connected components. The largest of these components should not have size greater than some threshold. So if one such cut vertex exists, I need to fi...
Foreword : by "typeless programming language", I naively mean "language in which you don't write statements like type x (=) ... to declare(define) x". Maybe there is an internal typing deduced from what is in ... but I suppose that this is not the case, as it is not the case in the example interesting me. (If "typeless...
I've written an algorithm for integer factorization (specifically RSA-like coprimes - products of two large primes, roughly of the same number of decimal digits) which is not based on QS, GNFS or any similar known one. https://github.com/plktrautman/BlueShift For any given n=p*q, consider a quadron with 5 parameters: U...
I am not able to understand below problem, mainly the example. I have tried to ask explanation in their website but not received help yet. how they are calculating 36 and 43? and why 36+43 = 30$ is written? Can I get a diagram visualizing this, because I think wood cutter should cost 12$ because only 3*4 area is needed...
Can we convert an NFA having $n$ states to a regular expression of length $\mathrm{poly}(n)$? In contrast, it is well known that a regular expression of length $n$ can be easily converted to an $\mathcal{O}(n)$-state NFA.
Let's say we have given array $A = \{a_1, a_2, a_3,\dots,a_n\}$ of size $n$, and integer $L$, we want to find biggest integer $K$, such that the array without any subset of size $x, x\leq K$ will have sum greater or equal to $L$. Example $A = \{1, 2,3\}, L = 2$, in this case $K = 1$, because any subset of size $1$ will...
It seems, intuitively, that determining if an program halts when running on a TM should be as difficult as determining if a sentence is provable within a finite set of logical rules. Furthermore, there are as many sentences as there are program and there are as many finite set of logic rules are there are TM (there are...
Let's imagine a situation in order to fully understand the problem : let's say a lone human is walking back home at a very late time. He needs to find the safest path home. He naturally use the GPS with a start point A and a destination point B. Now the data I have may be GPS locations with an information stating the d...
A language $L$ is in $SPP$ if there is a $GapP$ function $f$ such that $x\in L\implies f(x)=1$ and $x\not\in L\implies f(x)=0$. By $x\not\in L$ I think we mean $x\not\in SPP$ correct? I would have thought $x\not\in L$ if there is no such $f$. Why is it not defined this way? In this case we have $x:f(x)\not\in\{0,1\}$....
I am currently taking a class in complexity theory and I am struggling with this question. We define a TM with Oracle per. Sipser 6.18 as: "An oracle for language $B$ is an external device that is capable of reporting whether any string $w$ is a member of $B$. An oracle Turing machine is a modified Turing machine tha...
Let $L$ be the language$\{\langle G \rangle : G\text{ is a CFG and L(G) accepts at least one odd-length strings}\}$. Prove that $L$ is decidable or undecidable. Here is my attempt: $L$ = On input $\langle G \rangle$, where $\langle G \rangle$ is a CFG: Construct CFG, such that $L(O)$ contains only odd length strings...
Consider the following problem: Input: We are given a set $S$ of $n$ binary vectors. A binary vector is of the form $(b_0, b_1, ... b_n)$, where $b_i \in \{0, 1\}$. Therefore, there are $n$ vectors of size $n$. Output: For each vector in $S$, we would like to (efficiently) compute a list of binary vectors from $S$ wh...
I am looking for an efficient algorithm to solve the following problem: Given $n$ points in 2D Cartesian space $p_1,\dots,p_n \in \mathbb{R}^2$ and an integer $m$, we want to find $s_1,\dots,s_m$ such that $1 \le s_1 < s_2 < \cdots < s_m \le n$ and that maximizes $$\sum_{i=1}^{m} \|p_{s_i} - p_{s_{i+1}}\|_2,$$ where $\...
An AVL tree is a BST, and a BST is a complete tree, but AVL tree doesn't necessarily have to be complete. Thus, why do we define AVL tree a BST?
http://jgaa.info/accepted/2011/HasheminezhadMcKayReeves2011.15.3.pdf Hello I stumbled upon this paper. On page $4/20$ the figure shows an infinite sequence of $5-$regular, connected planar graphs. But they do not define it rigorously. The first graph of the sequence is clearly the icosahedron, and I feel that the next...
For this question, I implemented this: public void setZeros (int[][] matrix) { firstScan(matrix); secondScan(matrix); } public void firstScan(int[][] matrix) { int i, j; for (i =0; i < matrix.length; i++) { for (j = 0; j < matrix[0].length; j++) {if (matrix[i][j] == 0) {markRowsAndColu...
I'm having problem trying to determine if all square numbers (1, 4, 9, 16, ...) written in binary form (1, 100, 1001, ...) is a regular language. After some attempts to find a common pattern of those numbers, I found out that for any square number $n^2$, $n^2 mod 4$ either equals to 0 or 1, and so I am able to draw a D...
It consists of one read only input memory and write only output medium. The computation proper takes place in a working memory of limited size. When stating that a problem can be solved with a certain number of bits, what we mean is that the working memory consists of that many bits. The input and working memories are ...
Are languages whose sets are empty recursively enumerable or recursive? For example, consider the language $L$ $\subseteq$ {0,1}*: $L$ = { $w$ | $w$ consists of only 0's} $\cap$ { $w$ | $w$ consists of only 1's } I believe this language creates an empty set. There are many different ways to design a Turing Machine th...
Let $$A= (Q,Σ,δ,s,F)$$ be a NFA. Prove the following statement: $∀q ∈ Q: (∃ w_2 ∈ Σ^* :δ (q, w_2) ∩ F \ne ∅ ⇒ ∃w_1 ∈ Σ^*:w_1w_2 ∈ L(A))$ I figured out that it means that if all the states have a path to the final state, that the word describing their path is a suffix of a word that is accepted from the NEA. The thing...
I have an NP-hard problem which I'm not going to tell you, and I suspect it becomes easier on planar graphs. I tried method Baker but it did not work because we have a restriction on vertices that avoid us to solve the problem in part of the graph then calculate the union of the solution in each part. Also, we try bidi...
Example of start top-left, Coin Collecting problem in grid: https://www.youtube.com/watch?v=94FEC_uNwVM Example of start bottom-right, Dungeon Game problem in grid: https://leetcode.com/problems/dungeon-game/description/ I knew the Coin Collecting problem, so I started trying to solve Dungeon Game the same way, startin...
Write $\bar n$ for the decimal expansion of $n$ (with no leading 0). For a set $S$ of natural numbers, let its set of expansions (in base 10) be $\bar S = \{\bar n \mid n \in S\}$. Is there a nice characterization of the sets $S$ such that $\bar S$ is a regular language? Obviously adding or removing a finite number of ...
There are two definitions of NP I found: 1) NP is a set of problems that have poly-size certificates, and with a given input, there is a poly-time certifier that checks the proposed solution. 2) NP is a set of problems that can be solved by non-deterministic algorithm in polynomial time. I think (1) is a standard def...
If the regular language $L$ is defined as $\{ w \in \Sigma^* \mid |w| \leq 140 \}$. Why does any DFA for it must have at least 142 states? Why not only 140 states?
I got recently confused when I noticed that there exists 2 types of polytime reductions, which lead to 2 different concepts of NP-hardness. This is well explained in the answer to this question: Can one show NP-hardness by Turing reductions? While a Karp reduction is required to show whether a problem is NP-Hard or co-...
Say I have a simple program that has the pseudocode like this: min = 1 max = 100 c = 5 random = randomInt(min,max) while(c != random): random = randomInt(min,max); Theoretically, from what I understand, I cannot guarantee this will halt. However, is this true for both PRNGs and say, random integers generated using...
Let $M=(m_1, m_2)$, $M'= (m_0', m_1')$ be two two-block messages. In other words, $|m_1|=|m_2|=|m_1'|=|m_2'|=n$. We say that $M, M'$ collide for key $k$ if $$E_k(E_k(m_1)⊕m_2) = E_k(E_k(m_1')⊕m_2').$$ How many two-block messages should one sample from $\{0, 1\}^{2n}$ s.t. with probability $≥ 1/2$ two (distinct) sample...
One used equivalence relation in regular languages is that for a language $L$ over alphabet $\Sigma$, $(x\sim^Ly)\Leftrightarrow (\forall w\in \Sigma^* xw\in L \Leftrightarrow yw\in L)$. That means, if two words $x,y$ are not in the same class, there exists $w\in \Sigma^*$ such that $xw\in L$ but $yw \notin L$. It is i...
I have a good idea of how deletion can be decoded in VT codes using Levenshtein algorithm. However, I don't have any idea how can an insertion be decoded? Can anybody give me a small example using a short VT code? Mostly papers say that a 1-deletion code can handle 1-insertion error as well, but I don't know how?
let ${L^*}$ be the Kleene star language which is definded like that : $${L^*}=\{w_1,w_2, \dots ,w_n\mid n \geq0 \text{ and each $w_i \in L$}\}$$ I have to show of this correct or not ! $$ {L^*} \text{is decidable } \Rightarrow {L} \text{ is decidable} $$ $\textbf{my idea was to use the reduction function }$ le...
How to solve this problem efficiently? You are to find all pairs of integers such that their sum is equal to the given integer number N and the second number results from the first one by striking out one of its digits. The first integer always has at least two digits and starts with a non-zero digit. The second intege...
If i want to calculate the movements of each moving objects driven by regular algorithm, then how to measure required computing power? Is required computing power proportional to the quantity of the objects? If so, how can i measure required computing power?
Consider a directed graph G = (V,E) with non-negative costs on each edge. With s being a starting vertex. Prove that by adding a constant k to each edge (s,u) ∈ E such as u ∈ V, the shortest path tree starting from s will remain the same. In an attempt to solve the above question (with a proof) I thought that if...
We define a language $L$: $\qquad L=\{\langle M,w,k \rangle \mid M(w) \text{ reaches configuration } \alpha q \beta \text{ with } |\alpha \beta| \geq k \}$ with $M$ Turing machines with state set $Q$ and tape alphabet $\Gamma$, $\alpha$ and $\beta \in \Gamma^*$ , and $q \in {Q}$. A configuration like this : 10q11 or B...
I am currently going over this paper, and in fact have already tried to implement it: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4634483/ [1] Paper looks at the amplitude of the step and the time between the swings. ALthough I seem to understand the general idea, I am slightly confused about one of the formulas, whic...
Problem: Let $\varphi = \varphi_1 \land \varphi_2$ be Deterministic Buchi Automata (DBA) expressible LTL formulas. Let $A$, $A_1$ and $A_2$ be translated DBAs such that ${\cal{L}}(A) = {\cal{L}}(A_1) \cap {\cal{L}}(A_2)$. What can be said about the relation between the number of states in $A$ and that in the synchrono...
I'm trying to come up with an algorithm for optimizing cutting a rod. Most of the examples I see online are for a stock of rod of a single length and optimizing the way to cut it up for max price. I need something where the user enters length cuts they want (e.g. 2 of 1" length, 5 of 6" length, 10 of 8" length) and th...
I know that the clock speed is determined by the slowest stage within the processor (usually fetch) because one clock cycle will take as much time as the slowest pipeline stage to ensure everything is synchronized. So as fetching from DRAM is usually the slowest stage (for example during LDR instruction to memory whic...
The problem I have been given is to find a two-tape ND Turing Machine over {a,b,c} that only accepts odd length strings with a c in the middle position. The problem with this is that the question specifies that it must be done in n+2 transitions. I can figure out how to do it in 1.5 * n transitions, by iterating over t...
I want to write a CFG that generates the words over {a,b} with the same number of ocurrences of a's and b's. I have come up with a couple of possibilties so far. I think they're correct but they're all ambiguous, and I want the grammar to be non-ambiguous, this is one option: S -> aX | bY | ε X -> bS Y -> aS This is...
I want to remove the epsilon transition from following grammar: \begin{eqnarray} S & \rightarrow & A | B \\ A & \rightarrow & \epsilon \\ B & \rightarrow & aBa \\ B & \rightarrow & b \\ \end{eqnarray} This is the result of removing $\epsilon$ transition: \begin{eqnarray} S & \rightarrow & \epsilon | B \\ B & \rightar...
Suppose $G$ is a CNF (Chomsky normal form ) grammar which has $v$ variables. ($|V| = v$) If there is a string that $G$ derivatives in more than $2^v$ steps, prove that $L(G)$ is infinite. Any ideas how can i prove this? I know derivation tree in a CNF grammar is binary. So my idea is to calculate maximum number ...
Just as the title says, I wish to check the position of a point relative to polygon in $\mathbb{R}^2$. My take on this problem is the following: 1) draw a horizontal line to the right of each point and extend it to "infinity". 2) cnt = number of times the line intersects with polygon edges. 3) if(cnt is odd or point i...
Lets consider the class of "simple" LOOP-Programs. A LOOP-Program P is inducively defined as: $P_1: x_i = x_j$ and $P_2:x_i = x_i +1$ are LOOP-Programs. We also define a length property $l(P)$ where $l(P_1) = l(P_2) = 1$ P: $P_1;P_2$ is also LOOP. (sequential execution of statements). The length of these programs is $...
I came about this problem looking for interesting DP problems. I tried with no luck to find which could be the overlapping sub-problems to explore and solve and tabulate. But it is my belief there are none and this problem can't be solved using DP. Explanation of the problem rules can be seen here: A turskish Roulette...
Define a "non-standard" flow to be a flow where the quantity flowing through an edge may be negative. Formally, given a directed graph $G$, and two designated and distinct vertices $s$ and $t$ (such that no edges are leaving $t$, and no edges are entering $s$), a non-standard flow $f : G_E \to \mathbb{R}$ is a v...
You are given a Graph G and an integer k. The question is: Does G contain a vertex set X of size at most k such that deleting X results in a graph of degree at most 1? Design an FPT (or a kernelization) algorithm for this problem and argue why it is correct. Hint: Observe that vertices of higher degree must be "dealt w...
I'm still confused with the terms Weakly NP-complete and strongly NP-complete. Many people states that weakly NP-complete problems are the problems with time complexity growing as a polynomial in the magnitude of the input, while strongly NP-complete problems are the problems with time complexity growing as a polynomia...
At section 8 of the paper On the Synthesis of a Reactive Module, the authors state the following theorem: Proposition 2 (Non-Emptiness Condition) Let $A = (Q, \delta, Q_0, \Omega)$ be a tree automaton with $\Omega = \{(L_i, U_i) | 1 \leq i \leq m\}$ and $|Q|=n$. Then, $T_\omega(A) \neq \emptyset$ if and only if for so...
BQP : (bounded-error quantum polynomial time) is the class of decision problems solvable by a quantum computer in polynomial time, with an error probability of at most 1/3 for all instances. Question : We know that $\mathsf{P}$ and $\mathsf{NP}$ classes are defined on Turing model of computation where as $\mathsf{BQP}$...
My confusion arises when solving the average case. I thought that it would be: 1/n * (number of elements) But in the solution, they do 1/n * (sum of all the elements). I know that this all goes down to N when in big-o notation but why are they summing all elements of the array and how did they get to just the sum formu...
If a CNF contains only Horn and Xor clauses, and does not contain clauses of other types, then can its Satisfiability be determined in polynomial time?
My intuition says it would simply be the number of edges leaving s. I'm assuming it's a valid flow network so sum of capacities leaving s is the same as the sum of capacities entering t, so a max flow exists. This variation simplifies the running time because for any augmenting path, we can add the same amount of posit...
According to "Constructible function", Wikipedia: In complexity theory, a time-constructible function is a function f from natural numbers to natural numbers with the property that f(n) can be constructed from n by a Turing machine in the time of order f(n). But $\log\left(n\right)$ doesn't map onto natural numbers b...
I want to show this problem is decidable by describing a TM that answers the question. I originally thought this was quite simple, and that the answer would just be a TM that outputs "yes" for any valid input of a TM M. My reasoning was that given any TM M, we can just add a new unreachable state to it and the new mach...