instruction stringlengths 35 29.1k |
|---|
For what size alphabet does it take longer to construct a suffix tree - for a really small alphabet size (because it has to go deep into the tree) or for a large alphabet size? Or is it dependent on the algorithm you use? If it is dependent, how does the alphabet size affect Ukkonen's algorithm?
|
I can see how adding 2 unsigned $n$-bit values is $O(n)$. We just go from the rightmost digits to the leftmost digits and add the digits up sequentially. We can also perform multiplication in polynomial time ($O(n^2)$) via the algorithm we all learned in grade school.
However, how can we add up or multiply say $i$ numb... |
Possible Duplicate:
Complexity inversely propotional to $n$
I'm curious if anyone's come up with a problem or method as n => infinity t => 0. Are there any sort of cases found in quantum computing?
|
In this Wikipedia article about the Clique problem in graph theory it states in the beginning that the problem of finding a clique of size K, in a graph G is NP-complete:
Cliques have also been studied in computer science: finding whether there is a clique of a given size in a graph (the clique problem) is NP-complete... |
Possible Duplicate:
Solving or approximating recurrence relations for sequences of numbers
I know that the solution for $T(n) = 2 T(n/2) + O(n)$ is $ T(n) = O(n \log(n))$
But how do you get to that point? I don't understand when it says put t into the equation repeatedly until it drops out...
Any help?
|
Many common operations are monoids. Haskell has leveraged this observation to make many higher-order functions more generic (Foldable being one example).
There is one obvious way in which using monoids can be used to improve performance: the programmers is asserting the operation's associativity, and so operations can ... |
Let $P$ be a transition matrix of a random walk in an undirected (may not regular) graph $G$. Let $\pi$ be a distribution on $V(G)$. The Shannon entropy of $\pi$ is defined by
$$H(\pi)=-\sum_{v \in V(G)}\pi_v\cdot\log(\pi_v).$$
How do we prove that $H(P\pi)\ge H(\pi)$ ?
|
I understood what amortized analysis does, but can anyone tell me what is the main purpose of this kind of analysis?
What I understood:
Let say we have 3 three operations a,b,c used 1,2 and 3 times to achieve d. Based on aggregate analysis a,b and c are used 2 times each. Is this correct?
I am trying to understand the ... |
The following problem was on my final and in Gate 2006, but I don't understand how to solve it:
Different methods of memory management have different overheads:
The paging method for memory management uses two-level paging, and its storage overhead is $P$.
The storage overhead for the segmentation method is $S$.
Th... |
I am new to "Computational Complexity" and therefore I have enough problems with some exercises like the following one:
Remember: $\text{PH} := \bigcup_{i} \Sigma_i$
Show:
$\bullet \bigcup_{i}(\Sigma_i \cup \Pi_i \cup \Delta_i) = \bigcup_{i}\Sigma_i = \bigcup_{i}\Pi_i = \bigcup_{i}\Delta_i$
$\bullet \forall k \in \mat... |
I'm currently learning computer science, and there is a slide of notes brief described the parallel radix sort under data parallelism.
number 101 110 011 001 111 (1st bit)
order 2 1 3 4 5 (new order)
number 110 101 011 001 111 (2nd bit)
order 3 1 4 2 5 (new order)
number 101 001 110 011 111 (3rd b... |
I think the following exercise is to "warm up", but nevertheless it's quite difficult for me:
Let $k \in \mathbb{N}$ and let $L \in \Sigma_k$. Show that also $L^{*} \in \Sigma_k$.
The following details from my lecture notes seem to be useful:
Notation. Let $n \in \mathbb{N}$.
We write $\exists_n y. \varphi(y)$ for $\... |
Subset-sum: Given a list of numbers, find if a non-empty sublist has sum 0 (there's a variation where we want sum=k instead of 0, but 0 is easier for analysis)
Partition: Given a list, can it be partitioned into two non-empty sublists with equal sum?
I want to reduce subset-sum to partition. The reductions I found so... |
Here's a lab from a first-year computer science course, taught in Scheme: https://www.student.cs.uwaterloo.ca/~cs135/assns/a07/a07.pdf
At the end of the lab, it basically presents the halting problem, and shows that it is impossible to solve by introducing the function diagonal, which is defined as:
(define (diagonal x)... |
I was looking at Gödelization in Theory of Computation course. I could understand the Gödel numbering concepts, but couldn't understand its importance in Theory of Computation. Could anyone please point to some good materials or point out its importance.
|
The following exercise gives me headaches:
Show: If the polynomial hierarchy is strict (i.e. $\forall k \in \mathbb{N}. \Sigma_k \neq \Sigma_{k+1}$), then there is no $\text{PH}$-complete problem for polynomial-time reductions (i.e. there is no problem $\text{P} \in \text{PH}$ such that each problem in $\text{PH}$ can... |
We know that counting the number of Hamiltonian paths is in $\#\mathsf{P}$.
So, what complexity (counting version) class would the counting the number of Hamiltonian paths that have two or three particular vertexes in a graph be in?
Also, what would be like if counting the number of hampaths that have two or three part... |
I'm constructing a deterministic finite automata (DFA) for a language of all strings defined over $\{0,1\}$ whose length is even and number of $1$s is odd. I constructed each DFA separately and then combined:
Is the given procedure for combining DFAs correct?
EDIT: Originally wrote union; actually taking the intersec... |
The Bellman-Ford algorithm determines the shortest path from a source $s$ to all other vertices. Initially the distance between $s$ and all other vertices is set to $\infty$. Then the shortest path from $s$ to each vertex is computed; this goes on for $|V|-1$ iterations. My questions are:
Why does there need to be $|... |
I posted the same Q at programmers.SE, but nobody really helps.
In the paper “An Extended Comparative Study of Language Support for Generic Programming” by Garcia et al. an interesting comparison of programming languages features for generic programming is given:
with the brief explanation of terminology:
Can anyone ... |
Optimization factoring:
Input: $N\in \mathbb{N}$
Output: All prime factors of $N$
Decision factoring:
Input: $N, k\in \mathbb{N}$
Output: True iff $N$ has a prime factor of at most $k$
How can I solve the optimization problem in polynomial time if the decision problem is polynomially solvable?
|
I am stuck on this problem:
Given an array $A$ of the first $n$ natural numbers randomly permuted, an array $B$ is
constructed, such that
$B(k)$ is the number of elements from $A(1)$ to $A(k-1)$ which are smaller than $A(k)$.
i) Given $A$ can you find $B$ in $O(n)$ time?
ii) Given $B$ can you find $A$ in $O(n... |
Please help me calculate the time complexity of the following program.
int fun (int n) {
if (n <= 2)
return 1;
else
return fun(sqrt(n)) + n;
}
Please explain.
There were four choices given.
$\Theta(n^2)$
$\Theta(n \log n)$
$\Theta(\log n)$
$\Theta(\log \log n)$
|
So I would like to show that the class of Recursively Enumerable languages are closed under the shrink operation. In other words, $\text{shrink}_a(L) = \{\text{shrink}_a(w)\mid w\in L\}$ and where $\text{shrink}_a(w)$ is the string formed from $w$ by replacing every maximal substring of two or more $a$'s by a single a.... |
Is it always true that a problem which is ${\sf NP}$-hard but not ${\sf NP}$-complete is an optimization problem such as Minimum-Vertex-Cover and many others.
Is it always true that a ${\sf NP}$-complete problem is always a decision problem such as vertex cover of size $k$, independent set of size $k$ and many others.... |
I've read that "Every problem in NP can be reduced to every NP-complete problem".
My question is on the choice of the word "reduce". If I were to "reduce" a polynomial problem in NP to an exponential problem in NP, I just plain feel weird about using the word "reduce" because I feel like I've increased the problem, no... |
System has a two level paging scheme
Average CPU time for a instruction = 100ns
Average number of memory accesses per instruction = 2
Regular memory access = 150 ns
Page fault service time = 8ms
TLB hit ratio = 0.9
Page fault rate = 0.0001
What is the average instruction time if the time required for address transl... |
$L_1$ is a recursively enumerable language over some alphabet
$\Sigma$. An algorithm effectively enumerates its words as $w_1, w_2, ...$. $L_2$ is another language over $\Sigma \cup \{\#\}$ as
$\{w_i\#w_j : w_i, w_j \in L_1, i < j\}$ Consider the following
assertions.
$L_1$ is recursive implies $L_2$ is recurs... |
I have to find a negative cycle in a directed weighted graph. I know how the Bellman Ford algorithm works, and that it tells me if there is a reachable negative cycle. But it does not explicitly name it.
How can I get the actual path $v1, v2, \ldots vk, v1$ of the cycle?
After applying the standard algorithm we already... |
The title of the question expresses what I'm looking for - this is to help me better understand the prerequisites for the Non-Deterministic Time Hierarchy Theorem
For instance, the Arora-Barak book explains the theorem using $g(n) = n$ and $G(n) = n^{1.5}$ - but, I can see that $n \in o(n^{1.5})$ as well! So, I'm tryin... |
An independent set $I$ is a subset of the nodes of a graph $G$ where: no 2 nodes in $I$ are adjacent in $G$. For natural number $k$, the problem $k-\text{IND}$ asks if there is an independent set of size $k$.
I'd really love your help with showing that $k-\text{IND} \in {\sf L}$, i.e., can be decided using deterministi... |
I'm currently studying for an exam for a course where some of the material covered included finite state automata, I've completed a question and I'm not sure about my answer.
Exercise
Explain what is meant by a Finite State Automaton (FSA) by drawing an FSA to recognise strings of the form $a^rb^s$, where $r\gt0$ and $... |
I am wondering why some methods transform the underlying graphical model (Bayesian Network for example) to a junction tree¹? What are the advantages? Also what are the limitations?
I believe it's for computational purposes. If that's the case under what circumstances it is not recommended to transform the underlying... |
Integer linear programming (ILP) is an incredibly powerful tool in combinatorial optimization. If we can formulate some problem as an instance of an ILP then solvers are guaranteed to find the global optimum. However, enforcing integral solutions has runtime that is exponential in the worst case. To cope with this barr... |
EDITS: corrected $r$ to add edges just like $f$ does in paragraph 8 per the first comment below. Also specified the Clique problem of interest in paragraph 2.
Having received no response to this question on math.SE, I'm asking it here. Thanks for your help.
In the Wikipedia article on the Clique problem, we are told th... |
Aren't there $n^2$ unique substrings of a string (irrespective of the alphabet size)? Perhaps the number of unique suffix substrings is less than the number of unique substrings of a string.
|
Consider a set of functions:
head(l) returns first bit from list l, e.g.
head([0,1,0]) = 0,
head([1]) = 1
tail(l) returns a list by removing first element from l, e.g.
tail([0,1,0]) = [1,0],
tail([1]) = []
a:l appends bit a to beginning of list l, e.g.
1:[0,1,0] = [1,0,1,0].
xor takes takes as input two bits and ... |
for ( i = n , j = 0 ; i > 0 ; i = i / 2 , j = j + i ) ;
All variables are integers.(i.e. if decimal values occur, consider their floor value)
Let $\text{val}(j)$ denote the value of $j$, after the termination of the loop. Which of the following is true?
(A)$\quad \text{val(j)} = \Theta(\log(n)) $
(B)$\quad \text{val(... |
Identify the language given by $L = \{ x \in (0,1)^* : x \neq ww^R, w \in (0,1)^*\}$. Note: $w^R$ is the reverse of the string $w$.
Closure property can/should be applied only in the cases when the actual language is not specified. Otherwise, you may arrive at wrong conclusions. The language in question is fully specif... |
making exercises to prepare a test I'm having problems to understand 2 questions, the questions are:
how many are the leafs of a decisional tree associated to any algorithm for
the search problem in a ordered set?
for this question I have 2 set of answer where, for every set, 1 is right, looking at the solution I... |
Consider the following property of recursively enumberable (RE) languages
$$ L = \{ J \in \text{RE} \mid J \cap L_{uni} \ne \emptyset \}$$
where $L_{uni}$ is the language of the Universal Turing machine.
I am wondering if $L$ is semi-decidable. That is (by definition) if the set $$ S = \{ \langle T \rangle \mid L(T) \... |
I'm trying to study for an exam and having difficulty with the following practice questions. Any help would be appreciated.
Give a language $L$ such that $L$ is not recursive but $\text{prefix}(L)$ is regular.
Give two languages $L_1$ and $L_2$, such that $L_1$ and $L_2$ are not recursive, but $L_1\cap L_2$ is recursi... |
Given a universe $U$ consisting of k sets of vectors with each vector $\vec{v} \in {\mathbb{F}_{p^m}}^n $. Given also another vector $\vec{c} \in {\mathbb{F}_{p^m}}^n$.
Now decide if there is a set $X$ with $|X| = |U|$ and $X_i \in U_i, i = 1,2,...,k$ such that $\sum\limits_i X_i = \vec{c}$. If there is, output this se... |
1.
L2 = E{0,1)
All the words in L2 with equal number of 0's and 1's and every prex of w has at most two more of either
0's or 1's.
2.
All words that does not contain “bbb” as substring.
i think this is :( e + b + bb)(a + ab + abb)*
Thanks in advance!
|
So, I was trying to learn machine learning, and, after watching a couple of Andrew Ng's lectures decided to try and write a simple piece of code to determine what someone's salary would be based on the number of years they worked at a company by this simple linear function:
salary = w1 * numberOfYears + w0
I then used ... |
I am learning about software design patterns by reading Wikipedia pages about them. A lot of the patterns such as the bridge pattern have diagrams with boxes and different kinds of arrows:
Source: Wikipedia
Do these diagrams stem from a standard? Why do some arrows have different ending markings? Also, why are some of... |
I'm reading a book about computer network theory, and one topic is discusses is routing algorithms. It only mentions (probably not intentionally) how routers participate in forming the understood network topology stored in each routers memory - the routing tables.
So this brings me to my question, do Host acts like d... |
Data structures are seen as important, equal to algorithms. This view is especially encouraged in situations, where appropriate data structure is the main factor that allows an algorithm to exist and to perform at satisfying complexity.
However, despite the additional features of data structures (e.g. organization, lik... |
For Shamir's secret sharing scheme (doi 10.1145/359168.359176), one obtains a random polynomial $q$ of degree at most $n-1$ (over $\mathbb{Z}_p[x]$). The constant coefficient of this polynomial is defined to be the key. Then the scheme sends to player $i$ the value $q(i)$ (for $i \leq k$ for some fixed $k$). The inte... |
I think I'm confused about deletion in heaps, and since I have an exam today, I'm looking for your help to correct me.
I will post photos since it will makes it a bit more clear.
Note(forget about deleting the root)
What I understand is that , heaps only deletes the root element or the top. So, I made 2 solutions and ... |
In class this week we've been learning about the CFLs and their closure properties. I've seen proofs for union, intersection and compliment but for reversal my lecturer just said its closed. I wanted to see the proof so I've been searching for the past few days but all I've found is most people just say that to reverse... |
Given $n \in \mathbb{N}$ and $p,q \in \mathbb{N}[x_1,\ldots,x_n]$ one can define the following formula in the language of formal arithmetics
$$\varphi(n,p,q) = \forall x_1 \cdots \forall x_n : \neg (p(x_1,\ldots,x_n) = q(x_1,\ldots,x_n))$$
I would like to show that there are infinitely many triples $(n,p,q)$ such tha... |
Problem: Suppose $V$ is an AVL tree (a self-balancing binary search tree) of $n$
elements. After the insertion of $n^2$ elements, what would be its
height?
My idea: the height of an AVL tree is originally $O(\log(n))$ where $n$ is the number of elements. After insertion of $n^2$ elements, its height will be:$$O(\... |
I am trying to understand how a OUTER UNION $∪^✳$ works, and why it is only partially compatible.
I am aware this operation was created to take union of tuples from two relations if the relation are not type compatible (which I understand).
Examples of this operation will be great!
|
I experience a difficulty in solving exercises in distributed algorithm. Below is the the exercise I try to solve, it looks like I miss basic idea.
Exercise. Consider a 15-processor asynchronous network with processors 0,…,14. The processors constantly run a synchronizer. Let $v$ and $v'$ be two processors in the netw... |
I'm trying to figure out how a pushdown automata (PDA), which we know uses a stack (LIFO) can be simulated by a queue (FIFO). I understand that in a regular PDA, we only have access to the top most element which can be popped. When we push something, it goes to the top of the stack.
In a queue, as I understand, elemen... |
I don't understand this definition of an "instance" of a problem. Quoting from the CLRS book on page 1054 on abstract problems (Chapter 34.1):
We define an abstract problem $Q$ to be a binary relation on a set $I$ of problem instances and set $S$ of problem solutions.
|
For a given input $N$, how many times does the enclosed statement executes?
for $i$ in $1\ldots N$ loop
$\quad$for $j$ in $1\ldots i$ loop
$\quad$$\quad$for $k$ in $i\ldots j$ loop
$\quad$$\quad$$\quad$$sum = sum + i$ ;
$\quad$$\quad$end loop;
$\quad$end loop;
end loop;
Can anyone figure out an eas... |
I am interested in self-reducibility of Graph 3-Coloralibity problem.
Definition of Graph 3-Coloralibity problem.
Given an undirected graph $G$ does there exists a way to color the nodes red, green, and blue so that no adjacent nodes have the same color?
Definition of self-reducibility.
A language $L$ is self-reducible... |
Unfortunately I have no idea how to show this:
Show that the set of ${\sf P}$-complete languages is not closed under intersection.
As far as I understand my lecture notes, ${\sf P}$-completeness is defined as follows:
$A \subset \Sigma^{*}$ is complete for ${\sf P}$ iff $A \in \text{P}$ and $\forall B \in {\sf P}, B... |
Consider the following language over the alphabet $\mathcal{A} = \{a,b,c\}$:
$$L = \left\{w \in \mathcal{A}^* \mid \text{\(|w|\) is odd and the middle character in \(w\) occurs nowhere else in \(w\)} \right\}$$
I am trying to come up with a grammar for $L$, but I'm getting nowhere. I came up with some sample strings fr... |
I don't know exactly how to solve the exercise below.
Show that the multiplication lies in $\text{FL}$.
Hint: A useful approach to a solution is to split the exercise into two parts and to explain that each function lies in $\text{FL}$. The standard multiplication scheme can be used as an intermediate step. Example:
$... |
I am reading Papadimitriou, Computational Complexity, page 24, where it is says
We say that $M$ accepts $L$ whenever for any string $x \in (\Sigma - \{\sqcup\})^*$, if $x \in L$, then $M(x) =$ ``yes''; however, if $x\notin L$, then $M(x) = \nearrow$.
The key issue is what happens for $x \notin L$. This definition i... |
If an optimization problem is known to be inapproximable up to some precision, does this automatically imply that the problem is apx-hard?
|
Deterministic context-free languages are commonly defined using an automaton concept, the (restricted, deterministic) pushdown automaton. To some that is confusing, as the name context-free refers to a grammar type.
I seem to remember there exists a characterization of the DCF languages using grammars. In my recollecti... |
$\newcommand{\np}{\mathsf{NP}}\newcommand{\cc}{\textrm{Circuit-SAT}}$I am having difficulty understanding the $\np$-hardness proof for $\cc$ in CLRS.
$\cc = \{\langle C \rangle : C \text{ is a satisfiable combinatorial boolean circuit} \}$
Lemma: The $\cc$ problem is $\mathsf{NP}$-hard.
Can anyone provide an easy-to-... |
I am building a program that uses branching-and-bounding to find an optimal path in a complete graph (the heuristic, faster algorithm is the second part). I have to begin and end at node 0. I was given a large hint that eliminating "hopeless" branches early in the algorithm will lead to an overall much faster runtime. ... |
I am investigating a convex hull algorithm that involves sorting. In fact, its running time is limited by sorting, so it is $O(n \log n)$, where $n$ is the number of points on the plane.
That algorithm first sorts the points by x-coordinates. It then includes the first and last points in the convex hull. From there on,... |
I was wondering if someone knew the origin of the client server model. Where does the term come from (paper, software application, book)?
|
The following exercise is difficult for me:
Show that for each $k \in \mathbb{N}$ the question of existence of a $k$-clique within a graph lies in $\text{L}$.
Hint: A $k$-clique denotes $k$ verteces within a graph that are all connected with each other.
Annotation: if the question also considers $k$ as parameter, then... |
I want to be able to locate a substring in a string allowing for a specified number of mismatches, insertions and deletions - and at the same time know how many mismatches, insertions and deletions were used for any match.
Using brute force backtrack I can find the matches, but I cannot guarantee that the match was pro... |
I am looking for a proof for the following problem:
For languages $L$ and $R$, if $L$ is deterministic context-free
and $R$ is regular, then $LR$ is a deterministic context-free
language.
Note: $RL$ may not satisfy this condition, e.g. if $L=\{wcw^R\mid w\in (a|b)^*\}$, and $R=\{a\}^*$.
|
In my studies in computability I have come across the notion of the "machine", an abstract representation of a device that essentially computes. I have read about Turing Machines and Wolfram's binary cellular automata and I understand them.ie. the rules, states, colours, etc. and how they work. They begin in some state... |
Given an undirected Graph. I want to find a hamiltonian path with no restriction to starting or ending vertices. I know there are some smart algorithms for solving that.
Now let's make things interesting: sometimes, when I arrive at a vertex, the edges connected to that vertex change. I.e. some will be removed, others ... |
The Josephus Problem asks where to start taking out every kth person in the circle consisted of n people, such that you are the last "survivor".
The following recursive formula is given:
$$\begin{align}
f(1,k)&=1, \\
f(n,k)&=((f(n-1,k)+k-1) \bmod n )+1.
\end{align}$$
But this is not enough explanation, so I don't get w... |
What are the differences between computer vision and image processing? For example, in object recognition, what are the roles of computer vision and image processing?
|
I'm trying to understand a proof regarding radix-sort but to no avail.
I'll first write down a brief summary of the proof and then assign some questions which I hope will be clarified enough.
Suppose you have an array of integer numbers in the range $\{0,1,2,\ldots n \log n\}$.
Show and explain an effective algorith... |
How can you perform the clique decision algorithm fewer than $ O(n) $ times to solve clique optimization?
I'm not sure if my approach is right but this is my thought process: you would pick vertices in a graph and see if they form a clique, then keep picking more vertices until you have the max possible clique.
I'm not... |
I am doing research on control flow analysis on aspect oriented programs and I found in some papers an interprocedural approach for doing control flow analysis on others call graph or control flow graph. Is there a real difference between control flow graphs and interprocedural control flow graphs?
|
I have found an efficient algorithm for verifying if a string $\omega$ is of the form $0^n1^n$, where $n \in \mathbb{N}$.
Scan across $\omega$. If a 1 appears before a 0, then reject.
Repeat so long as some 0s and some 1s remain on the tape.
Scan across $\omega$. If the total number of 0s and 1s remaining is odd, rej... |
Apparently, for every k-tape Turing machine that runs in time $O(t(n))$, there exists a 1-tape Turing machine that runs in $O(t^2(n))$.
I can see how any multi-tape machine $M$ can be simulated by a 1-tape machine $S$. Just have the tape of $S$ contain all of $M$'s tapes separated by some symbol such as #.
However, why... |
I have devised the following TM for the language EQUAL.
EQUAL accepts all strings with the same number of a's and b's. It is context free but non regular.
Using the TM I devised, how can I show that EQUAL is recursive? How can I show that it crashes when the input is not in EQUAL.
|
According to a book I am reading, the unary representation of a number exponentially larger than a base k representation of it. I, however, feel that the unary representation should scale linearly with the input.
After all, 1 is 1, 2 is 11, 3 is 111, and so on, right? Wouldn't that be linear?
|
How can you show that coloring search can be solved by making a polynomial number of calls to the solution for coloring optimization or coloring decision? (Coloring search is the algorithm to color the vertices of a graph such that adjacent vertices have a different color.)
I wasn't sure how to solve it, but here is wh... |
I have read of an algorithm that a non-deterministic Turing machine $N$ can run to determine whether a given graph $G$ has a Hamiltonian path from the start node $s$ to a certain node $n$:
Write a list of $x$ numbers $p_1, p_2, p_3 ... p_x$, where $x$ is the number of nodes in $G$. Each number in this list is non-dete... |
To show that a NP problem is NP-complete, we also have to show that $L \leq_{p} L'$ , where $L$ is proven NP-complete and you have to prove $L'$ also is. The thing I am confused is how in all NP-complete problems in CLRS they just state the reduction algorithm for $L$ to convert to $L'$ is polynomial. How can one prov... |
Question 1: What is the average access time for a 3-level memory system with access time $T_1$, $2T_1$ and $3T_1$? (Hit ratio $h_1$ = $h_2$ = 0.9)
The solution given is: $0.9[T_1] + 0.1(0.9[2*T_1] + 0.1[3*T_1]) = 1.11[T_1]$ (Method 1)
Here, they have considered the page won't be copied to the lower level. Otherwise, i... |
I am interesting in proving that there is no search problem that is polynomial bounded and self-reducible, as long as ${\sf P} \neq {\sf NP} \cap {\sf coNP}$.
The problem is I don't know how to approach the proof, below I wrote few ideas with open questions.
We can start by denoting the search problem in set ${\sf NP... |
The intervals are represented as two numbers, e.g. $(4.3, 5.6)$. The intervals are unique.
If for $(x,y)$ and $(u,v)$, $x≤u$ and $v≤y$, $(u,v)$ is nested in $(x,y)$
How do I find out which intervals are nested in others efficiently?
The hint is to use two induction hypotheses: one to assume you can solve the problem f... |
It might sound like a stupid question but I'm really curious to know how a computer knows that $1<2$? Also, how does a computer know that the order of integer is $1,2,3,4,5,\ldots$ and alphabet is A,B,C,D,...? Is it somewhere stored in the hardware or does the operating system provide this kind of information?
|
I was wondering how should I proceed in order to show that the composition of (say) two one-way functions (either weak or strong or both together) is not a one-way function?
Specifically: Say $f$ and $g$ are one-way functions (either weak or strong).
How do I prove that their composition $g(f(x))$ is not necessarily a ... |
Inspired by this question on Suffix Trees, and the fabulous winning answer, I would hereby ask for a similar explanation of Myers' Fast Bit-Vector Algorithm for Approximate String
Matching Based on Dynamic Programming.
|
There are two stacks A and B.
A : a,b,c,d ('a' is on top and 'd' is at the bottom of the stack)
B : (empty)
There are two rules.
If an element of A is popped, it must be printed immediately or pushed into B.
If an element of B is popped, it can only be printed.
So, how many permutations of a,b,c,d are possible? ... |
$3^n = 2^{O(n)}$ is apparently true. I thought that it was false though because $3^n$ grows faster than any exponential function with a base of 2.
How is $3^n = 2^{O(n)}$ true?
|
I am looking for O(V+E) algorithm for finding the transitive reduction given a DAG.
That is remove as many edges as possible so that if you could reach v from u, for arbitrary v and u, you can still reach after removal of edges.
If this is a standard problem, please point me to some model solution.
|
I am trying to reduce NOT-ALL-EQUAL SAT to MAX-CUT with weighted edges.
I know that if there are weights to the edges, then I can reduce NOT-ALL-EQUAL SAT to MAX CUT by have a $G$ with $2n$ nodes ($x_i$ and $\bar{x}_i$) and edges between the nodes based on each clause. And, adding edges between $x_i$ and $\bar{x}_i$, ... |
It is well-known that 1-in-k SAT is NP-complete for k=3. What about for k > 3?
|
I need a clarification related to the following situation.
Consider a Turing machine $T_1$ that halts for every input. In other words $J_1 = L(T_1) \subseteq \Sigma^*$ is recursive. Suppose we are given a function $f:\Sigma^* \mapsto \Sigma^*$ and a language $J_2 \in \Sigma^*$ such that $$ x \in J_2 \iff f(x) \in J_1.$... |
In famous Structure and Interretation of Computer Programs, there is an exercise (1.14), that asks for the time complexity of the following algorithm - in Scheme - for counting change (the problem statement suggests drawing the tree for (cc 11 5) - which looks like this):
; count change
(define (count-change amount)
... |
We are given two strings $x=x_1,x_2,x_3,\ldots,x_m$ and $y=y_1,y_2,y_3,\ldots,y_n$ over some finite alphabet.
We consider the problem of converting $x$ to $y$. Using the following operations:
1.Substitution: replace one symbol by another one.
2.Insertion: inserts one symbol
3.Deletion: delete one symbol.
For exampl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.