instruction
stringlengths
35
29.1k
Hello I am trying to understand the GBN protocol and I encountered the following question during my homework. Assume that we have GBN protocol with a window size of 20. The sender sends 15 packets one after the other with seq numbers from 1-15. After that, the sender is waiting to get acks from the server (the sender ...
For the 2017 and 2018 Random SAT Tracks of the SAT Competition ran by the International Conference on Theory and Applications of Satisfiability Testing there are small, yet difficult, random 3-SAT problems with planted solutions labeled "barthel," "qhid," and "komb." I have been able to determine that "barthel" is ref...
In Turing Machine, we know that there's (fine-grained complexity) difference between one-tape, 2-taped and multi-taped TM, even though they could be simulated efficiently. (Well, actually I'm not quite sure they are indeed seperated: i.e. $TIME(t)\neq TIME_{2-taped}(t)\neq TIME_{multi-taped}(t)$ ) But today I'd like to...
I'm reviewing DP and I was wondering the intuition behind determining the subproblems for some DP problems. For example, consider 2 similar problems. Given a set of 1, 2, and 3 steps you can take, find the total number of ways to reach X steps. Given a set of 1, 2, 3 coins, find the total number of ways to reach X amou...
I've a problem where I have to prove the following statements: (i) if $SPACE(n) \subseteq P \implies SPACE(n^2) \subseteq P$ (ii) if $P = SPACE(n) \implies SPACE(n) = SPACE(n^2)$ For the Space Hierarchy Theorems we have that $\forall f(n) = o(g(n)) \implies SPACE(g(n)) \nsubseteq SPACE(f(n))$ Using this result and the ...
At this link you can read Nicola Gambino's slides on one way to approach the formal syntax of Martin-Löf dependent type theory. (They are concise and very readable.) On slide 10, he gives a standard definition of a context as a list of the form $$x_1:A_1, \ldots, x_n:A_n $$ where the $x_i$ denote pairwise distinct va...
We are given a 1-d array and we have to return the smallest array attainable after removing all the continuous same numbers. We can only eliminate those numbers which repeat continuously more than or equal to 3 times. So for eg. [1, 3, 3, 3, 2, 2, 2, 3, 1] should return [1, 1] i.e. first the elimination of 2's occurin...
I have studied in my Computability course that it is impossible to design an algorithm $A(x,y)$ which decides, for every couple of programs ($P_1$, $P_2$), whether they are equivalent (e.g. $\forall x \in Data:P_1(x) = P_2(x)$). This is easily shown with Rice's theorem. I was wondering if a similar problem with SQL que...
I'm interestd in string-matching, I would like to know recent open problems in string-matching in field of bioinformatics.
I'm working on the following problem: HALFCYCLE (HALFC): Input: A directed graph $G = (V,E)$. Output: Whether the longest cycle in $G$ has length $ \lfloor |V|/2 \rfloor$. Prove that if $\mathsf{PH} \ne \mathsf{coNP}$ then HALFCYCLE is not NP-complete. I have no idea how to solve this implication.
Consider the set $\mathbb{B}^n$ of all $n$-digit binary numbers. Let us define a bitmask as a tuple $M=(m_0,\ldots,m_{n-1})$, where $m_i\in \{0,1,*\}$. Such bitmask denotes a set $S \subset \mathbb{B}^n$ containing all numbers with digits $b_0...b_{n-1}$ such that $\forall i \in [0, n-1]: m_i \neq * \Rightarrow b_i=m_i...
I'm not sure if I understand the following definition of the (well-known apparently) Graphic TSP, also known as graph-TSP : ...graph-TSP, that is, the traveling salesman problem where distances between cities are given by any graphic metric, i. e., the distance between two cities is the length of the shortest path in ...
I have some trouble understanding some exercises related to operations on regular languages.I tried to apply their closure properties, but I am not sure how to do the following exercises: If $L_2,L_3$ are regular and $L_1 \setminus L_2 = L_3$, is $L_1$ also regular? If $L_2,L_3$ are regular and $L_1 \cap \overline{L_2...
Assume $NTime(2^n) \subseteq NSpace(n^k)$, for some fixed $k$. Is it possible to imply that $EXP = PSPACE$? and what about $NEXP = PSPACE$? It seems the answer might be YES, because this question seems to be equivalent to the open question $EXP=PSPACE$? Can it be shown using some padding argument?
For reference, the version of the nondeterministic time hierarchy theorem in question is this one: The relevant portion of the proof in question (also from Arora-Barak) is here: Arora-Barak define a NDTM as identical to a deterministic TM except that NDTMs have two transition functions such that either may chosen non...
We are given complete graph, such that each edge has two costs $a \text{ and } b$. We should find path that passes through each node once and has minimum total cost. Cost of a path is the maximum of both of the sums $a$ and $b$ of the edges laying on the edges crossed on the path. One person told me that this is easil...
I was wondering if it is possible to merge standard STL maps in O(log(n)) using DSU trick. For example, Map a={{1,2},{3,2},{4,3}}, Map b={{2,3},{3,2},{4,1}} and Map c={{2,1},{3,2},{4,4}} Then the resultant map will be : {{1,2},{2,4},{3,6},{4,8}} If not achieveable by DSU, is there any other algorithm to achieve this i...
Why can't we generate the output of cellular automata at time step t without first generating all the preceding states? Why can we do this for some functions? What features of a function does it relate to? Is it about whether it can be graphed as a line or a curve? Why can't we come up with a function that takes in a c...
So the definition of a compiler I got is that: A compiler takes a string as input and checks if that string is syntactically correct, then outputs "Yes" or "No". So does that mean all compilers are Turing Machines?
I have a table that looks like this In table NPC - are AI like characters that move from one point to another. Player - a character that is controlled by the user. In any moment the player character might move to any cell of the table. But NPC has a particular goal cell that they should reach while moving. For exampl...
How does one prove that a suggested heuristic is admissible? Is this even possible? For Example: Let's say I have the game Free Cell. Rules: https://en.wikipedia.org/wiki/FreeCell How can I prove that the number of cards not in the foundation plus every out of order card is an admissible heuristic?
Let $PATH = \{(G,s,t) \mid \exists \text{path from}~s\text{ to }t\text{ in }G\}$, where $G$ is a directed graph. We know that $PATH$ is $NL$ complete. I am wondering what the complexity class of $PATH$ on undirected graphs is and whether any hardness results for $PATH$ on undirected graphs are known?
I am currently getting ready for my final exam in computational models. I know that there aren't any rules or rule of thumb to show that a language is NP-complete and each problem has its own tricks, but I am really struggling with questions where they give me a language and showing that the language is NP-complete by ...
I am currently taking a course which involves computational complexity. I was told that polynomial equivalence (polynomial time reduction) divides P into exactly 3 equivalent classes, namely $\phi$ , $\Sigma^*$ and $P - \{\phi,\Sigma^*\}$. I am unable to figure out how this is true, specifically how if $L_1,L_2 \in P, ...
We call the word $x_1$ a true prefix of the word $x$, if a non-empty word $x_2$ exists so that $x=x_1x_2$. For the language L (over some finite $abc$..). We define MAX(L) as: $MAX(L)$ = {$w_1 \in L $| $w \notin L$ so that $w_1$ is a true prefix of $w$} prove (or disprove): If the language L is CF then the language $MAX...
Provide any polynomial-time algorithm (even a large degree polynomial) which determines whether two rooted colored trees are isomorphic to each-other or not. For example, consider the following two trees: Example trees T and U are isomorphic. An isomorphism (bijection) is described in the table below: T ...
Say $ \Sigma = \{a\} $, $M_1, M_2, ... $ is an enumeration of all TMs that recognize languages over $\Sigma$ and $L_1, L_2, ... $ are respectively the languages that are recognized by those TMs. We construct the language $ L = \{ a^n\ |\ a^n \not\in L_n \} $. Is $L$ Turing recognizable (recursively enumerable)? My ...
We are given a simple functional language: $ e ::= x | n | e_{1}e_{2}|\lambda(x:\tau).e$ with types: $\tau ::= \text{int} | \tau_{1} \rightarrow \tau_{2}| \tau_{1} \land \tau_{2} $ Is the expression $ (\lambda x.xx) (\lambda y . y) $ typeable in this system? Let's denote $x:\tau_{x}, xx : \tau_{xx}$. I'm rookie in the ...
Let $T$ be a tree with $n$ nodes. If I remove $k$ edges from $T$, I will have $k+1$ new trees i.e. a forest of $k+1$ trees. How do I calculate the number of nodes in each of these new trees formed? I need to do this for $q$ queries. My approach: I can remove the $k$ edges from the original tree and run DFS on each nod...
Let's say we have n (e.g. 6) children and a box of candy. The box has k (e.g. 8) different flavours, and m (e.g. 4) piece of candy in each flavour. This question is specifically about the cases where k > n and n > m. We can assume a maximum of a 1 piece of a flavour per person. We ask them to make a list of the flavour...
I have a weighted DAG and a function computing the weight of edges that is not connected in the DAG. The weight of u to v equals to the weight of v to u. I want to connect edges to make the DAG a single strongly connected component (any vertex in the new graph can reach any other vertex) with minimum total weights of a...
Can somebody explain the following: (source: fbcdn.net) U is a universe of keys, and H is a finite collection of hash functions mapping U to {0, 1, … , m-1}. I do not understand definition 2, and thus why amount of funtions that map x and y to the same location is given by |H|/m.
Given two arrays both of length n, you have to choose exactly k values from the array 1 and n-k values from the other array, such that the sum of these values is maximum, with constraint that if you choose a value from some index of any of the array you cannot choose from same index of second array. I have encountered ...
$L_1$ = $\{\langle M \rangle \mid M$ is a turing machine and $M$ halts on some string$\}$ $L_2$ = $\{\langle M \rangle \mid M$ is a turing machine and $M$ halts on all strings $\}$ a) Is $L_2$ a superset of $L_1$ ? b) Is $L_2$ not co-recognizable and not recognizable ? (without formally proving) my attempt $a)$ $L_2...
This question pretty much explains that they can, but does not show any examples of there being two different trees with the same pre-order traversal. It is also mentioned that the in-order traversal of two different trees can be the same though they are structurally different. Is there an example of this?
There are many different but equivalent models of computation. I assume their equivalence is shown by coding input of one model to the input of the other model and making an argument why should there exists the same algorithm that would solve the problem on that model (e.g. emulation). I was wondering, if there's a mod...
Construct the CFG given the following language: $$\{a^i \; b^j \; c^k \;|\; i = j \; or \; j = k \}$$
I want to show that $USTCON\le_L CO-2Col$ (Log-Space reduction) $USTCON$ The $s-t$ connectivity problem for undirected graphs is called $USTCON$. Input: An undirected graph $G=(V,E)$, $s,t \in V$. Output: 1 iff $s$ is connected to $t$ in $G$. $CO-2Col$ A graph is $2$-colorable if there is a way to color the vertices ...
Suppose $\Sigma = \{a,b\}$. Is the following claim correct? There exists a Turing-recognizable language $L \subseteq \Sigma^*$ such as its complement is not Turing-recognizable, and for all $n \in \mathbb{N}$ it contains exactly $n$ strings of length $n$. I'm kind of lost here. Any help would be appreciated.
Database System Concepts by Abraham Silberschatz, Henry F. Korth and S. Sudarshan says Information extraction using simple patterns, which separately match parts of a page, is relatively error prone. Machine-learning techniques can perform much more sophisticated analysis, based on interactions between patterns...
It's well known $EXP$ is closed under polynomial reduction. It means $\bigcup_{c \ge 1} \mathsf{DTime}(2^{c^{n}})$ is closed under polynomial reduction. But what about $\bigcup_{c \ge 1} \mathsf{DTime}(2^{cn})$? Is it also closed under polynomial reduction?
Let me show the problem on an example... An actual task from one of the former exams: Consider a simple functional language: $$e::= x|n|e_1e_2|\lambda x.e$$ With typing rules: $$\tau ::= \mathtt{int} | \mathtt{foo} | \tau_1 \rightarrow \tau_2$$ $$\Gamma \vdash n : \mathtt{int}$$ $$\Gamma (x : \tau) \vdash x : \tau$$ $...
Let's suppose that we have the following 2 tables: If we want to reduce the dimension by one(in every table) which feature we should remove and why ? I am confused about the way that i should work generally in this type of problems.
Can someone tell me what am I doing wrong? Problem: https://codeforces.com/contest/22/problem/B Editorial: https://codeforces.com/blog/entry/507 ( I followed the DP solution O((n*m)^2) ) Eg: 00001 00000 10100 //ans is 12 ####1 ####0 10100 My approach: rectangle with coordinates (x1, y1, x2, y2) is correct if an...
I have a large database of data with dates. There are large gaps and large chunks of data without gaps. I want to get a sample of this data such that the dates are as spread out as possible (i.e. as close to evenly distributed as possible). E.g. if the dates are [1, 2, 3, 4, 100] and I want to sample 3 elements, the id...
I've been reading about Google's TensorFlow, and the way it represents calculations with graphs that are then executed by an engine. While the concept is interesting, I would like to understand why they made that choice instead of the arguably simpler imperative programming found e.g in PyTorch. The TensorFlow document...
Both Stephen Wolfram and Nobel laureate Gerard 't Hooft think that the universe is a cellular automaton. As far as I know, 't Hooft developed a series of frameworks to build different models of cellular automata and Wolfram also proposed a framework where network nodes could produce different cellular automaton univers...
Is the Simple Uniform Hashing Assumption (SUHA) sufficient to show that the worst-case time complexity of hash table lookups is O(1)? It says in the Wikipedia article that this assumption implies that the average length of a chain is $\alpha = n / m$, but... ...this is true even without this assumption, right? If the ...
As an example of languages that are in P/poly is the UHALT Problem : UHALT = { 1^n: n's binary expansion encodes a pair such that M halts on input x} We can create a boolean circuit of just AND gates. However, we can create it only for a fixed 'n', not for all n's ... My question is : when we consider a language l...
It is easy to know that there are LALR(K) grammars which are not LL(K) because any grammar with left recursion which is LALR(K), is not LL(K) because all LL(K) grammar must be left recursion free. And the opposite? Is there a LL(K) Grammar which is not LALR(K) Grammar? Do you have an example? Related: Are regular expr...
Assume we have i stacks. the possible actions are: push to first stack form input pop from stack i and push it to stack i+1 pop from last stack to output If we have numbers of 1 to n starting from 1 in the input, what is the minimum value of i which can generate all permutations of 1 to n at the output? The options ...
Since there exists a bijection of sets from $\{0,1\}^*$ to $\mathbb{N_0}$, we might view one-way-functions as functions $f :\mathbb{N_0} \rightarrow \mathbb{N_0}$. My question is, suppose $f,g$ are one-way-functions, is then $(f+g)(n):=f(n)+g(n)$ a one-way-function or can one construct a counterexample? (The length of ...
I am trying to understand how the cyclic redundancy check (CRC) algorithm from the Controller Area Network (CAN) specification works. Here is the pseudocode. CRC_RG = 0; // initialize shift register REPEAT CRCNXT = NXTBIT EXOR CRC_RG(14); CRC_RG(14:1) = CRC_RG(13:0); // shift left by CRC_...
I posted this question on mathoverflow two years ago but got no answer: Let $w = a_0 \cdot a_1 \cdots a_{n-1} $ be a word from $ \{0,1\}^n $, $|w| = n$ Let $m = \sum_{i=0}^{n-1}{ a_i \cdot 2 ^ {n-1-i} } $ be the corresponding binary number constructed from the word. Let $k= \left \lfloor \frac{n!}{2^n} \right \rfloor...
Given $$\mathrm{\#3SAT} = \{ (w, y) \mid w\text{ is a $\mathrm{3SAT}$ instance with at least $y$ satisfying assignments}\}\,,$$ prove that $\mathrm{\#3SAT}$ is NP-Hard. I am currently stuck with this one. Basically $\mathrm{\#3SAT}$ is the counting version of $\mathrm{3SAT}$ and to me it is seems clear that establis...
What are good approximations for computing log1pexp for single precision and double precision floating point numbers? Note: log1pexp(x) is log(1 + exp(x)) I have found few implementations of log1pexp for double precision but they don't provide an explanation on how they arrived at the approximations. Hence, I am not ab...
So I came across this problem in my textbook. I was wondering how to develop a reduction from the Graph Reachability problem to SAT (CNF) problem. (i.e. formula is satisfiable iff there exists a path in graph G from start to end node) 1) I can't wrap my head around how to go from something that can be solved in polynom...
Let's say we are given array $A$ of size $n$. We need to answer some numbers of queries. For each query we are given index $i$ and integer value $k$, $k \le i$. If we take the first $i$ elements of the array $A$ and we sort them we should return the one on index $k$ (we assume everything is 1 indexed). I know that thi...
Here's an example of what I mean: def complexity(n): count = 0 for x in range(1, n+1): for y in range(1, (n*n)+1): if y % n == 0: for z in range(1, n+1): count += 1 return count The first for loop is of course θ(n), the second one θ(n^2). But what imp...
I'm trying to prove NP-hardness of 3 SET PACKING, which is a following problem: given a family of sets where each set contains 3 elements, decide whether the family contains k sets that are pairwise disjoint. I tried reducing 3 SAT, but to now avail, but reduction of any other NP-complete problem would be helpful.
Considering the definition, $f(n) = O(n^k)$, for some constant $k$. If I choose $k = 100$ and plot, it shows $n^{100} > \lceil\log n\rceil!$ for all $n > 1$. However, the solutions to Introduction To Algorithms (2009) say that $\lceil\log n\rceil!$ is not polynomially bounded. What's going on?
Hello I have the following task (no homework). You are using the Reservoir Sampling algorithm. You process the 2000th element in the data stream and are maintaining a sample of size 500. What is the probability of the first element in the sample being replaced by the current element? My problem is, that I have no i...
As per my understanding. The space complexity will be O(V). An array of V nodes will be created which in turn be used to create the Min heap. But this link is stating that It is O(V^2)? I don't understand how it can be O(V^2)? I have search the same topic in the Book entitled Introduction_to_Algorithms by Thomas H. C...
To solve an instance of an edge cover, we can use the maximum matching algorithm. Edge Cover: an edge cover of a graph is a set of edges such that every vertex of the graph is incident to at least one edge of the set [from Wikipedia]. Maximum matching: a matching or independent edge set in a graph is a set of edges wit...
I want to create a Context-Free grammar that generates the language $$ L = \{ w \in \{0, 1\}^* |\ \text{number of $0$'s is even, and number of $1$'s is also even} \}. $$ I came up with $$ S \rightarrow 0S0S\ |\ 1S1S\ |\ ABABS\ |\ BABAS\ |\ \epsilon \\ A \rightarrow 0A0A\ |\ 1A1A\ |\ 0\\ B \rightarrow 0B0B\ |\ 1B1B\ |\...
Consider this example: stmt => if (expr) stmt | if (expr) stmt else stmt | other Why can't we use shift-reduce on this? This is a compiler homework and I really need to answer it.
A friend of mine appeared in an exam recently, and one of the question asked was regarding CPU Registers, which has two points: (a) CPU Registers are part of Primary Memory (b) They are volatile And the choices given were: Both (a) and (b) are true Only (a) is true Only (b) is true None of the above They are volati...
Consider the MAX-CUT problem. We can flip $n$ coins to generate a random cut, and by linearity of expectation we get that with "good probability" our cut we'll be bigger then $\frac{n}{2}$. Using pseudo random generators (XOR for example) we can generate $n$ pairwise independent bits from $\log n$ random bits. Using ...
I want to prove that a language $L$ is not in $\texttt{DSPACE}(f(n))$, the class of languages that a deterministic Turing machine can decide with fixed tape length of $f(n)$ (wiki). That is, I want to prove: $$ L \notin \texttt{DSPACE}(f(n)) $$ How would I do this? My first attempt was to reduce a language $L'$ from $\...
Unfortunately I did a degree in CS without much theoretical computer science. One thing I used to hear is that sub languages, or languages which are not Turing complete, allow for better optimization? Why is this case? What is the thought process and what are some examples in practice? What are some good resources on t...
I read that complexity theory is the study of complex systems. While I associate computational complexity theory with classification of problems.
Consider the following desicion problem: 3-Hitting Set - This problem is indentical to the classic Hitting Set problem with the following constraint: Each set has to be exactly 3 items long. Similarly to 3-SAT and SAT, It seems almost obvious that 3-Hitting Set is also NP-complete like the original Hitting Set problem....
E -> E * B . E -> E + B . E -> B . B -> 0 . B -> 1 . I am confused because Wikipedia cites this grammar as an example of an LR(0) grammar and constructs an LR(0) parsing table for this grammar, while Grammophone reports shift-reduce conflicts and marks some cells in the grammar's LR(0) parsing table red. (Th...
Is the following problem decidable? Given a context-free grammar $G$ and a regular expression $R$, is $L(G) \subseteq L(R)$? It is given that the following problem is undecidable Given a context-free grammar G, is $ L(G) = \Sigma ^*$ ? $\ (1)$ and this problem decidable Given a context-free grammar G, is $ L(G) =...
According to my instructor, $n\choose 2$ is the maximum number of minimum cuts we can have on a graph. To prove this, he showed the lower bound using an n-cycle graph. To prove the upper bound, he drew the argument from two facts: Probability of finding $i^{th}$ min cut $\geq\frac{2}{n(n-1)}=\frac{1}{n\choose 2}$ Even...
T(m,n) = T(m-1,n) + T(floor(m/2), n-1) Base conditions T(m,n) = 1 when n = 0 T(m,n) = 0 when m < n Edited: Below is the code for which I want to know the time complexity in terms of m and n. #Python3 program to count total number of #special sequences of length n where #Recursive function to find the number of #...
There is the Quine–McCluskey algorithm for finding a minimal expression of a boolean expression in dis-junctive normal form. Would applying DeMorgan's rule to the minimal DNF result in the minimal CNF? Is there an equivalent algorithm for con-junctive normal form? Not necessarily looking for something efficient as the ...
John Archibald Wheeler was a famous physicist. It has been stated that he thought that there was a strong connection between undecidability and quantum physics: This idea was given an early formulation by Wheeler himself: in unpublished notes to a discussion held with, among others, Roger Penrose and Simon Kochen, he ...
Let $N = (V, E)$ be a network in which the capacity of each edge is either $12$ or $18$. Prove or disprove: The value of a maximum flow for $N$ can’t be $56$. I'm trying to figure out how to definitely prove this. I think that this is not possible because of no combination of $12X + 18Y$ (where $X$ and $Y$ are integers...
Given an array A of n numbers and integers k and x. We can perform the following operation any number of times (including zero times). Take exactly k numbers from the array and replace each of them after doing xor with x . For example, we took ith element among k elements, we will replace Ai with Ai ⊕ x . We wish to ma...
When we are discussing the run time of an algorithm, are we referring to big-O notation or are we saying that the runtime is the same for all cases? For example; algorithm X runs in polynomial time.
I have learned python syntax (from books like fluent python or python cookbook etc.) and I want to learn the underlying concepts of computer science (in an abtract way), do you have some books/courses to suggest to me (others than algorithms and data structures' resources) I've found a book called Python Programming. A...
Given two problems A and B. Given two algorithms a' and b'. a' solves A and b' solves B. If A reduces to B and B reduces to A. Then can we say anything about a' and b'? Are they the same?
I was looking for some information on 1-in-3 SAT and came across this paper, last updated 9 days ago, which claims that the Polynomial Time Hierarchy collapses "to the level above P=NP". That's quite exciting if you ask me, although I don't have the toolkit to understand the actual proof. My question is about something...
If the set $P$ is defined as the set of decision problems that can be solved by a deterministic Turing Machine in polynomial time, and matrix inversion using Gaussian elimination is $O (n^3)$, then how can I relate these two concepts to conclude that inverting a matrix is in $P$? I suppose I need a way of converting a...
There are so many points in the coordinate system. When a specific point is given in the coordinate system, I want to find the closest point to the straight line distance. For example, if you have 800 points, calculate the distance 800 times and find the smallest value. But I want to make more efficient algorithm that ...
I was trying to solve the following question while reviewing master theorem. Which of the following asymptotically grows faster. (a) $ T(n) = 4T(n/2) + 10n $ (b) $ T(n) = 8T(n/3) + 24n^2 $ (c) $ T(n) = 16T(n/4) + 10n^2 $ (d) $ T(n) = 25T(n/5) + 20(n\log n)^{1.99} $ (e) They are all asymptotically the same My calculatio...
In a Turing machine, what is the difference between the instruction table and the algorithm? The instruction table seems to be an algorithm for completing the task no?
Why sum of two binary numbers cannot be determined in $NC^0$ but it can be determined in $AC^0$?
Given a turing machine which has unlimited memory and time, can it solve all problems or are there a class of problems that cannot be solved even with unbounded power. Is there a way to prove this?
I am trying to understand Multiway Cut, and basically how the Multiway Cut works. I am searching google many hours to find a good example to understand. A good example that I am trying to understand is this: http://crab.rutgers.edu/~rajivg/studentTalks/multiwayCut.pdf What I cannot understand, and here is the point I n...
A deterministic finite automaton without $\epsilon$ steps for the language $0^*1^*$ is required. Any nice picture ? I have created a NFA for this language which has 2 states $Q_1,Q_2$, both are accepting, $Q_1$ is initial, there is a move under $0$ from $Q_1$ to $Q_1$, a move under $1$ from $Q_1$ to $Q_2$ and finally a...
For even split binary search (repeated halving) number of queries is log with base 2. According to Skiena's Algorithm Design Manual, if the split in binary search is by ratio 1/3:2/3 instead of 1/2:1/2, then number of queries is log with base 3/2. Why is this so? Would someone please help me get an intuitive understand...
I think you can create the complementary language that is an element of DSPACE($f(n)$), where $f(n) \geq \log(n)$ by adding a step to the algorithm that reverses the answer. By that the function $f(n)$ does not change, therefore DSPACE($f(n)$) is closed under complement. I know that most likely my answer is wrong. Can...
Let $c\in(0,1/2]$ be a constant. Given a set of positive integers with sum $S$, is there a partition into two subsets such that both subsets have sum at least $cS$? If $c=1/2$, this is the famous partition problem which is NP-complete. What is known about the complexity for other values of $c$? I posted the question ...
Is the halting problem, only applicable for infinite languages? I assume that if the language is finite, then we can search over all words?
Below I will list a concrete example and the confusion it causes. Let's first say we have a decision problem, which is: "Is X <= 400?" We define the alphabet as the set of natural numbers. The language formed by this problem is $L = \{ w | w <= 400 \}$ We define a Turing machine, M, over the alphabet, that halts in an ...
I have the variable Si. How to express a variable Di in LP that satisfies: Di=100*Si if Si>=0 Di=-200*Si if Si<0 The objective function would be Min{Sum(Di)}
Is there an example of a "set of steps" that we thought was an algorithm, but later was shown not to be an algorithm because it could not be implemented on a Turing machine?
Is there a general framework for showing that a problem has no algorithm? For example, to show that two problems are equally as hard to each other, we use reduction. One example of where this was done, is Hilbert's 10th problem