instruction
stringlengths
35
29.1k
$M=(Q,\sum,\Gamma, \delta, q_{0}, q_{accept}, q_{reject})$ is a TM with one tape. let $c_{1}, c_{2}$ be two configurations of $M$. A configuration is defined like this: $uqv$ where $(q\in Q; u,v\in \Gamma^{*} )$ we say that $c_{1}$ is reachable from $c_{2}$ in $M$, if when $M$ is in configuration $c_{1}$ it can reach...
The P vs. NP poll provides 3 possibilities: equal, not equal, and independent. This is reasonable, because despite the law of the excluded middle you must supply a proof for your answer, which itself is insufficient. But then the statement "P vs. NP is independent" itself can be independent, with a proof. And this proc...
Given collections I (items) and S (slots), where I >= S. And a pairing function that determines whether a slot can accept an item. Is there an efficient way to find whether a "complete" pairing of items to slots exist, where "complete" means every slot is filled? (More importantly for my use case... is there a way, oth...
My understanding had been badly lacking in just what complexity theory was in the context of computer science. I thought it was abstracted to all mathematical problems applicable outside the realm of computation. Truthfully, I doubt I understand it. But seeing as how this is here to stay, here's an idea for a P=NP proo...
So this is my question. I am trying to understand this part of the book: At d) why do we stop looking at the other nodes in that branch? There could be a acceptable value next to the 2? I am just trying to understand alpha beta pruning for a while.
I have been studying data structures. In that I have come across topics like Array being defined as Power set of cross product of set of objects and set of natural number and list being defined as sequence of objects. I wanted to read more about these things but I haven't been able to find any reference. Can anyone hel...
Previously, I ask a similar question, but the answer given only demonstrates the usage of multiple-type-parameters(MTP) data structure, but not MTP generic interface. Based on my experience, generic interface is useful for generalizing algorithms. For example, the sorting algorithm can be defined as such: // Java code...
I am writing a work on pathfinding algorithms and DFS is a part of it. And the book Introduction to Algorithms and many another websites mention timestamps. And they say timestamps could be used for others algorithms using DFS, topological sorting and etc. So for pathfinding these timestamps dont really matter? Thank...
Here is the link to the puzzle: http://www.cs.brandeis.edu/~storer/JimPuzzles/ZPAGES/zzzQuzzle.html My idea is to construct the tree of all possible moves and then use a search algorithm (probably BFS or A*) to find the shortest path to the solution. This is the initial state: 1 1 2 2 1 1 3 4 0 0 3 4 5 6 6 7 ...
I have read multiple questions here that involve this kind of subject but I haven't found any definite answer. In what class do regular languages belong? (P or NP or some regular are P and other NP), context-free languages? (same question) ,context-sensitive? and general languages? . I personally believe all regular la...
I am writing a paper on the invariance thesis introduced by Cees F. Slot and Peter van Emde Boas as; 'Reasonable' machines can simulate each other within a polynomially bounded overhead in time and a constant-factor overhead in space. The paper I am writing is in Croatian where I cannot find a properly convenient wor...
How do we prove that any logical circuit can be simulated by a Turing machine? For example, we take a logical circuit $L$ that is made of gates and, or, and not. This circuit determines a problem, for example, whether the input is an even number. How can we prove that if a problem is decided by a logical circuit, ther...
I'm currently reading Foundations of Machine Learning by M. Mohri, A. Rostamizadeh, A. Talwalkar and according to their definition a concept class $C$ is said to be PAC-learnable if $$Pr_{S \sim D^m}[R(h_s)\leq\varepsilon] \geq 1-\delta$$ holds for any sample size $m \geq poly(1/\varepsilon,1/\delta,n,\mathrm{size}(c))...
I use interval arithmetic for reliable computing. Now, a procedure coded in a good implementation of interval arithmetic takes perhaps about eight times as much as the same procedure carried out without interval arithmetic (if the lion's share of runtime is taken by floating-point computations). I have sometimes been a...
Given a set of elements $U=\{1,2,\ldots,n\}$ and a collection of $m$ sets $\{S_1,S_2,\ldots,S_m\}$ whose union equals $U$. Each element $e$ of a set $S_i$ has a weight $w_i(e)$. The weight $w(S_i)$ of the set $S_i$ is defined as $w(S_i):=\max_{e\in S_i}w_i(e)$. The problem is to choose an ordered collection of sets $O...
It may seem obvious to many but i am having a hard time figuring out the iterative solution to the Tower of Hanoi problem. There are some solutions on the Internet but without explanations. So can anybody give a sound explanation so that it becomes more intuitive and easy to reason.
The problem is to try and find a word in a 2D matrix of characters: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more...
A similar question was asked here: Solving recurrences using substitution method, but I am still somewhat hazy as to how this process works. Say, for $T(n) = T(\lceil n/5 \rceil + 36) + n \log n$ Statement: we wish to prove that $T(n) \le 5 \ n \log n$ for $n \ge 0$ Base case, $n = 0$ and $T(0) \le 0$ $T(0) = 0$ $T(0) ...
$E_{TM}=$ { < $M$> $|$ $M$ is a TM; $L(M)$=$\varnothing$} Where $L(M)$ is the language accepted(recognized) by $M$. $OVERLAP_{TM}=$ {< $M_{1}$,$M_{2}$> $|$ $M_{1}$,$M_{2}$ are TMs; $L(M_{1})\cap L(M_{2}) \ne \varnothing$} Is there a mapping reduction of $E_{TM}$ to $OVERLAP_{TM}$ ?
Several questions (1, 2) have been asked about this topic already but I am trying to be more specific. In Tarjan's SCC algorithm, the calculation of lowlink when encountering a vertex which is already on the stack is // It says w.index not w.lowlink; that is deliberate and from the original paper v.lowlink := ...
Metropolis Light Transport is an application of the Metropolis-Hastings algorithm. Its variants differ only in the used "mutation strategy". Is there ongoing research on other Markov Chain Monte Carlo algorithms (with faster convergence rates) for use in ray tracing? If so, I'm interested in any paper. (Cross-posted on...
I've recently implemented RB tree, B-Tree and vEB tree. I was wondering however if there's any rule of thumb for testing if my implementation are actually correct. Is there any reference that can tell how to develop proper test cases for such data structures? Besides from mathematical techniques maybe. What about graph...
I have written two constraints for Mixed integer linear problem. I am working on the scheduling problem i.e., Scheduling of hybrid appliances. For example, the washing machine is appliance indicated by i, which has set of the task like washing, rinsing and spinning etc., indicated by j. Here we divided the 24 hours int...
Given an array of numbers. Find all pairs of numbers satisfying the condition $1/a + 1/b < 1$. For example: Input: $2, 3, 1, 0.5, 3, 1.6$. Output: $(2,3), (3,2), (3,3), (3,1.6), (1.6,3)$. We can compare each element with each other but it takes $O(n^2)$ complexity. How to improve that algorithm? Maybe use special str...
I've got an array of weights, for example [1, 0, 3, 5] The distance between two strings is defined as a sum of weights for different bits, like this: size_t distance(const std::string& str1, const std::string& str2, const std::vector<size_t>& weights) { size_t result = 0; for (size_t i = 0; i < str1.size(); ++i) ...
Edit: The solution to my problem is called a trie ; according to Section 8.1 of Peter Brass book "Advanced Data Structures", for a given alphabet $A$ and a word $w$ of length $n$ on this alphabet, a trie can search $w$ in $O(n)$ and insert or delete $w$ in $O(|A| n)$. Since in my case $|A|=2$, all these operations are ...
In the research on sorting networks, two parameters are typically of interest: The number of comparators required and the depth required. They have practical implications for throughput and latency. Results in latter category are usually easier to achieve than corresponding results in the former. Already in 1989, Parb...
What is the VC dimension of $k$ finite unions of one-sided intervals: If we take 3 one-sided intervals like $(-\infty, a_1] $, $(-\infty, a_2] $ and $(-\infty, a_3] $, I think union of these intervals can shatter $4 $ points as below, assuming that $a_1>a_2>a_3>a_4$: Point $p_1$ at interval $(-\infty, a_1]$ Point $p_2...
So we are calculating the loss $$J(\theta) = -\frac{1}{T}\sum_{t=1}^T\sum_{-m \leq j \leq m} \log P(w_{t+j}|w_t;\theta)$$ and to do this we need to calculate $$P(o|c) = \frac{\exp(u_o^Tv_c)}{\sum \exp(u_w^Tv_c)},$$ which is computationally inefficient. To solve this we could use the hierarchical softmax and construct a...
Given: A rooted, directed, a-cyclic graph $G$. Let $r_0$ be the root node and $t_0$ be another target node. Each node in $G$ is assigned a non unique id/color ($ID_i),\ 1<i<N$ for some integer N. Problem: Is there a directed path from $r_0$ to $t_0$, such that for some $ID_x$ there is no node in that path with $ID_x$ a...
I was reading the book Introduction to Algorithms, Chapter 1. When I saw this diagram, I got confused because $\lg n$ has the largest value of time while $n!$ has the least value of time. And that doesn't make sense to me - perhaps I misunderstood this?
Is this variant of Vertex Cover Cook-complete for $\mathrm{NP}$? Input: An undirected graph $G(V, E)$ together with a vertex cover $C\subseteq V$ Output: YES if there exists a vertex cover $C'\subseteq V$ such that $|C'|=|C|-1$, NO otherwise
How would you evaluate a new metric or benchmark? My concrete example: I want to benchmark code review. As others did [1, 2] , one can apply metrics from social network analysis (such as centrality, degree, ...) to a social network emerged from code review (who reviewed when whom?). But how do I evaluate if the metric...
deep learning research papers always claim that deeper layers of CNN have good "semantic information" but poor "spatial information". What is the spatial information exactly. Is that some activations in deeper layers?
I have a verification engine where while loops are translated into functional code, like this: def f() = ... while(c) b ... def f() = ... fwhile() ... def fwhile() = if(c){ fwhile() } We want for the users to be able to annotate while loops with a decreases construct which says that certain m...
Someone in a discussion brought up that (he reckons) there can be at least continuum number of strategies to approach a specific problem. The specific problem was trading strategies (not algorithms but strategies) but I think thats beside the point for my question. This got me thinking about the cardinality of the set ...
2^n=O(3^n) : This is true or it is false if n>=0 or if n>=1 since 2^n may or not be element of O(3^n) I need a hint to figure the problem
I know it's a keyword based search. But sites like Quora have some good suggesting algorithms where the algorithm understands the intent of question asked rather than just the keywords meanings. For instance, for a question involving "O(n^2)" it adds 'Algorithms' and 'Computer Science' as topics and for a question inv...
I'm a bit confused about some proof that PATH-SELECTION-PROBLEM is NP-complete (Problem 9, chapter 8 in "Algorithm Design" by Tardos and Kleinberg) that I found in some solution manual here: https://github.com/weimin/CS-180/blob/master/Algorithm%20Design%20(Kleinberg%20Tardos%202005)%20-%20Solutions/Algorithm%20Desi...
The buddy algorithm is: The buddy for any block of size $2^k$ is another block of the same size, and with the same page frame number except that the kth bit is reversed. Example: If the block size if $2^3$ and the start page frame number(aka pfn) of this block is 0xC, the page frame number of the buddy of this block ...
I am clearly not understanding the Busy Beaver function. Why wouldn't it be infinite for n > k, while(true) { print("1"); }
How can one generate all unlabeled trees with $\le n$ nodes? That is, generate and store the adjacency matrices of those graphs? (not just count them) Visualization of all unlabeled trees with $\le6$ nodes:
I have these in my lecture notes, its about the rules where knights always tell the truth and knaves always lie: If A says “The statement ‘there is gold on the island’ and the statement ‘I am a knight’ are either both true or both false” he is asserting A ≡ G where A is the assertion A is a knight and G the assertion t...
Suppose the function $f(n)$ is defined as the number of $\ast$ printed in the following code for(int i = 0; i<n; i++) { for(int j = i; j<n; j++) { for(int k = j + 200; k<2n; k++) { for( int r = k^2; r<n; r++) { print(*); } } } } I suspect the answer is $\...
I want to prove the search of an element in a Young tableau of size $n\times n$ is $\Omega(n)$, but I do not have any clue. Any help is appreciated!
Suppose a Turing machine $M$ has a read-only input-tape and $k$ read-write work-tapes whose non-blank cells are each bounded by $f(|x|)$ where $|x|$ is the length of the input. Is there some constant $C(k)$ and Turing machine $M^{'}$ with a read-only input tape such that $M^{'}$ accepts exactly when $M$ accepts, $M^{'}...
My main question is can with R.kanon , Fortnow ,... technique that shows lower bounds for SAT seperate P and NP ? Baker-Gill-Solovay showed that $P?=NP$ could not be solved with relativization. Does indirect diagonalization a relativized proof? Suppose with indirect diagonalization we show that $NP\not\subset A$ (A i...
Consider $$ \bigcup_{c \in \mathbb{N}} \mathsf{DSPACE}(2^{c (\log{n})^2}) \quad \overset{?}{=} \quad \bigcup_{c \in \mathbb{N}} \mathsf{DSPACE} ( n^{c \log{n}})$$ My lecture notes say that this is an equality, can someone point me to the theorem (or explain) why this is ? I've observed that one power of the logarithm...
I'm trying to build a list of algorithms/problems that are "exceptionally useful", as in, solving problems that 'seem' very exponential in nature, but have some particularly clever algorithm that ultimately solves them. Examples of what I mean: Linear Programming (The simplex algorithm is exponential time; it took a l...
Let a counting function inc for inputs of N bits be defined as: inc(b0 | b1 ... | bN) = F0(b0) | F1(b0,b1) ... | FN(b0,b1,...bN) Where FN is a function from N bits to a bit, and such that the period of inc is 2^N. Notice that, here, we have a special restriction: the nth bit of the output of inc must only depend on bi...
I want to generate a bunch of graphs of about 100 nodes, where each node is a categorial variable. I want the graphs to satisfy complex properties, like, "if a node of type A is connected to a node of type B, that node of type B should also be either connected to both a node of type C and a node of type D, or should b...
Suppose you have a maze represented by a graph where each vertex represents a room and edges represent paths between rooms and each edge has a weight denoting the time it takes to go that way. Now here comes the tricky part: suppose each room needs a set of keys for you to enter, and inside each room you can find anoth...
I know its very hard to show a human what the 4th dimension would look like and the mind can't even comprehend more dimensions, but what about a computer? How many "dimensions" can a computer handle? Or maybe a better way to ask, does computing power exponentially increase when extra dimensions are added?
A function $T: \mathbf{N} \rightarrow \mathbf{N}$ is time constructible if $T(n) \ge n$ and there is a Turing Machine $M$ that computes the function $x \mapsto \lfloor T(|x|) \rfloor$ in time $T(n).$ Here $\lfloor m \rfloor$ denotes the binary representation of $m$ for a natural number $m$. I understand that $T(n) \ge ...
I want to start a wiki post about meta-result of meta-reductions in the theory of $\mathrm{NP}$-completeness. This can be regarded as a reference request post. Any links are appreciated. At least, this can be helpful in drastically mitigating the frequently asked questions related to homework assignments that are givin...
In designing a public-key cryptosystem, there are often two desirable properties: Public/private key pair of each participant can be exchanged. Meaning that whenever a participant has generated a key pair $(a, b)$, it is free up to him to choose to public either $a$ or $b$ (but not both, of course) Encoding/decoding a...
I have came across a question stating that language $L = a^n b^n c^{2n}$ is not a context free language and hence, no PDA can be constructed for it. But what I am wondering is that, if I add another alphabetical comparison to the above language as $L_1= a^n b^n c^{2n} d^n$ $L_2= a^n b^{2n} c^n d^{2n}$ And a mixture o...
Given a graph and a set of origin-destination $\langle o_i,d_i\rangle$ pairs. The goal is computing a set of paths such that every pair has a path and number of common vertices between paths is minimized. If you have any relevant references to share I'd like to read them.
Suppose I have a vertex-disjoint set $S$ of simple cycles in a weighted undirected graph. So no vertex $v$ is contained in more than one cycle. A cycle $c$ is a closed path with no repeated vertices: $c=(v_1, v_2, \ldots, v_n)$, where $v_n=v_1$. Each edge $e=(v_i,v_j)$ has a positive weight $w(e)$. The weight of a cycl...
I recently came across this question: Let the following relation schemas be given: $R=(A,B,C)$ $S=(D,E,F)$ Let relations r(R) and s(S) be given. Give an expression in the tuple relational calculus that is equivalent to the following: a. $\pi_A(r)$ The solution provided is: $\{t|\exists q \in r(q[A]=t[A]) \}$ But acco...
The problem is that: in a directed acyclic graph $G$, I want to know the maximum vertices that can be covered by $k$ vertex-disjoint paths. Obviously, the value of $k$ is smaller than the minimum path coverage of $G$. Are there any approximation algorithms that can solve this problem?
I am trying to find a reasonable data structure for representing a partition of an (axis aligned) rectangular domain into a set of (axis aligned) rectangles. I need to be able to look up for a given point which (unique) rectangle contains it. So far I have taken a look at Quadtrees, and this seems reasonable to me - wh...
I am coming across two slightly different definitions of big-oh and need to prove that they are equivalent to each other: Definition 1: f(n) = O(g(n)) if there exists constants c and N such that f(n) ≤ c g(n) for all n > N. Definition 2: f(n) = O(g(n)) if there exists a constant c such f(n) ≤ c g(n) for all n≥1. Intuit...
I was wondering if there exists an efficient algorithm for calculating the "rolling mode of an array of integers. By rolling mode I mean that we have an array of integers of size $n$ and a sliding window of size $k$ and we we want to compute the mode for each window in the array. There is an algorithm to do this in $O...
In "Computational Complexity" by Arora and Barak they state that the following is $NP$-complete: $\{ \langle \alpha, x, 1^n , 1^t \rangle : \exists u \in \{0,1\}^n \text{ s.t. } M_{\alpha} \text{ outputs } 1 \text{ on input } \langle x,u \rangle, \text{ within } t \text{ steps} \}$. They call this language $TSAT$. I a...
The question comes from the following scenario, assume we have the traveler problem which is NP (the one where a traveler wants to visit all countries with the lowest cost(by summing up all flights)) So basically Neural Network can not just predict, but generate results from things they've learned, for instance, traini...
The title says it all. The language $\{ a^{2^n} \mid n \in N\}$ looks quite simple. Yet I could not find a grammar that generates this language.
Question: Given Input: Courses and their dependencies(prerequisites) such as A < B; A < C; B < D; C < D return course order in the order a student can take. i.e answer should return A, B, C, D or A, C, B, D I solved the problem, but the running time is very slow, I cannot seem to figure out how to improve my algorithm....
Question: Given two sorted arrays A1 and A2, check if A2 is a subset of A1. Also, assume there might be duplicates. Example: A1 = [0,0,0,0,1], A2 = [0,1] // should return true A1 = [-1,0,1,2,3,4,5], A2 = [1,2,3] // should return true Answer: My answer is below and works, but I believe my running time is slow. Not ...
I have an array of distinct integers which I want to save in the most compact manner. I may have to do occasional lookups, deletions, and insertions in this array so the compression algorithm must adjust for such cases. What is the appropriate algorithm/ data structure that I should think of? Is there anything along th...
Could someone give me a simple explanation why an oracle machine that can solve the halting problem for standard Turing machines, is however unable to solve the halting problem for other such oracle machines? I have tried searching for the answer online but could not find any that really answered the question.
A few days ago, I proposed the Abstract Calculus, a minimal untyped language that is very similar to the Lambda Calculus, except for the main difference that substitutions are O(1) (i.e., variables only occur once) and copying is an explicit, constant-time and incremental operation. Here is an example: let (a & b) = (λ...
Given a list with $n$ positive elements and positive number $k$, determine whether there are two numbers whose difference is less than $k$. The average time complexity should be $O(n)$, and the memory should be $O(n)$ as well. My attempt: initialize a hash table, and insert every element from the list to the hash, a...
What is the biggest complexity class that is low for each other equivalent definition of $\mathrm{PP}$? I already know that $\mathrm{PP}^\mathrm{BQP}=\mathrm{PP}$. This is a lowness result using standard definition of $\mathrm{PP}$. Since, it is known that $\mathrm{PP} = \mathrm{PostBQP} = \mathrm{PQP}$. If we use $\m...
In this process list situation How can I find the quantum time ( time slice ) at 80% of CPU time ? I found only for 100% of CPU time, so I don't know if it's the same for 80% case B.T.Q= [mean + median ] / 2 mean=(P1+P2+P3+.....Pn) / n
I am working on a task embedding sentences into a lower-dimensional space according to style, both grammatical and lexical. As such, I want to have as input the linear ordering of tokens in each sentence, together with its dependency parse as provided by spacy. In particular, I'd like to find a way to tie together th...
My question is about the quantum computer. I have tried to prove that the quantum computer is equivalent to some logical circuit. I know this has already been proven, but I will present my attempt: First we know that the quantum computer is composed of quantum logic gates https://en.wikipedia.org/wiki/Fredkin_gate. Ac...
I was reading David Marr's "Artificial Intelligence-A Personal View" and he talks about "computational theory of AI" or what he laters labels as "Type 1" Theory. He provides the example of Chomsky's notion of "competence theory for English syntax as an example of what he means by that. However, with the current trend o...
Google's new in-production OS which it desires to replace not only Android but many other devices utilizes a completely new kernel: The code differs from Android and Chrome OS due to its being based on the "Zircon" kernel (formerly "Magenta") rather than on the Linux kernel. https://en.wikipedia.org/wiki/Google_Fuchs...
Given n points and 0 < p < n, find the maximum number k of rectangles such that each rectangle contains at least p points and no two rectangles overlap. Each point is distinct from every other point, and the edges of all rectangles must be parallel to the coordinate axes. For example, 1 rectangle can contain all n poi...
I have an assignment, it's asked to write a context free grammar recognising the language $L=\{ w \mid w\text{ has an even number of }0\text{s and an odd number of }1\text{s}\}$, over the alphabet $\{0,1\}$. My first guess was: $$ \begin{align} S &\rightarrow A1A\\ A &\rightarrow A0A0A \mid A1A1A \mid \varepsilon \end{...
Is it proven that $\mathrm{PP}$ has uniform constant-depth threshold circuit?
What are the consequences of proving some relation ($\subseteq$, $\subset$, $=$, or $\neq$) on one of the following, to the other? $P$ vs. $BPP$ $P$ vs. $NP$
Let L be a problem that DTM can't solve. Can we prove that there is an abstract machine that can solve this problem? Here, L is not Halting problem or Hilbert's tenth problem (because we proved that algorithms for these don't exist). In other words, is there an abstract machine more powerful than DTM? If not, how do we...
Sorry if I am doing it wrong in some way. Some days ago I have passed trough an technical test in which I had 3 tasks to complete. The tasks were a problem and I have to write an algorithm to solve it. One of the 3 tasks I could not complete. Really, I have absolutly no idea how to start. I am not asking for ready algo...
I have seen many research papers with log space algorithms, but not many with $AC^0$ algorithms. Is there any reason for this. Question : Are $AC^{0}$ algorithms interesting to research communities?
I would appreciate some help with this question. The 32 bit numbers below represent a MIPS instruction. identify the different fields and state which instruction it is. give the assembler source code that can be converted into this instruction. 001000|10001|10010|0000000000001111 I separated the bits and I know the fir...
Suppose I have a graph $G$ and a set of target nodes $S = \{A_1, ..., A_n\}$. I'm attempting to find the shortest path that visits each target node, in order, without visiting the same node twice. For example, consider the following: I have attempted to solve this by first performing a breadth-first search to find the...
Assuming there is no attack/bug and I use NTP: Are there any formal guarantees about the accuracy of the local time? Can there be any over the network? Even if the communication is going directly between the time server (stratum-1) and the client, I have no idea if the devices / protocols on OSI layer 1-4 have time gua...
In my book, this formula is given for calculation of address of row major order's element $[I,J]$: Address of $[I,J]$th element in row major order $= B + W[n(I-L_r)+ [J-L_c]]$ where B denotes base address, W denotes element size in bytes, n is the number of columns; $L_r$ is the first row number, $L_c$ is the first c...
I have the following definitions Definition nat'' {X : Type} := (X -> X) -> X -> X. Definition nat' := forall (X : Type), @nat'' X. And when I wanted to prove a certain property I ended up in the following situation: m : nat' H : 0 = m nat S 0 X : Type s : X -> X z : X ============================ m X s ...
Having read all these posts Constant-depth threshold circuit for $\mathrm{PP}$ Is there any interesting consequence of $\mathrm{DLogTime}$-uniform ${\mathrm{Mod}_6}^0=\mathrm{NP}$ I wonder about the weakest possible reduction for 3-$\mathrm{SAT}$ to be complete for $\mathrm{NP}$?
It is a classic problem to simulate a fair coin with a biased one. According to Fair Coin (wiki), John von Neumann gave the following procedure: Toss the coin twice. If the results match, start over, forgetting both results. If the results differ, use the first result, forgetting the second. In the worst case, the ...
I am working on an assignment where one of the sub questions is: Let $A$ and $B$ be languages. Suppose $A$ is context free and $A ≤_m B$, which means that there is a computable function $f\colon \Sigma^* \to \Sigma^*$ such that for all $w \in \Sigma^*$, $w \in A$ iff $f(w) \in B$. Is it possible that $B$ is regular? ...
I understood that a NTM can say only yes but it doesn't know if the input is a NO instance with a single execution. Furthermore, the NTM can diverges and, at the same time, can decide a language (source: Papadimitrou - Computational Complexity, proposition 7.1). While a TM must converges in a "yes" or "no" answer to de...
We define an initial function called projection as $$I^k_i(n_1,\ldots,n_k) = n_i, \quad i \leq 1 \leq k, \quad k \in \mathbb{N}.$$ Suppose now that we want to define it in some programming language where we have no access to superscripting nor subscripting. Should we call it Iki or Iik? My stand point is that it should...
I'm trying to implement a simple image segmentation application that accepts an initial contour and evolves it to compute a refined contour in successive iterations. I'm taking some inspiration from the explanation provided here: https://profs.etsmtl.ca/hlombaert/levelset/ I'm having trouble understanding what exactly ...
I'm trying to prove the following problem: Show that $RP$ is closed under concatenation Now, let's say that the two languages are $L_{1}$ and $L_{2}$ (both in $RP$). Then I accept a word iff the TM of $L_{1}$ accepted the first part of the word (with a probability $\geq\frac{1}{2}$), and the TM of $L_{2}$ accepted th...
The question is clear from the title. What is the complexity of the following decision problem: Input: An undirected graph $G(V, E)$ Output: $\mathrm{YES}$ if $G$ can be decomposed into two edge-disjoint spanning trees, $\mathrm{NO}$ otherwise
For example the nodes in this graph should be separated into two groups (A,B,C) and (D,E,F,G). By looking at a graph of citations, assuming that most citations are papers from the same field, can we separate papers into fields?