instruction stringlengths 35 29.1k |
|---|
This is a Data structures & Algorithms question. For instance I have the following grades of functions: $O(1), O(2^n), O(n \log n), O(e^n), O(n^3), O(n^{1/3})$ and $O(\log \log n)$
I need to show and proof to which of these function grades does the function: $n^7$ belong to.
I didn't get a chance to ask my professor... |
I have a problem that I was able to conceptualize as following:
Problem
We have a set of n people. And m subsets representing their ethnicity like White, Hispanic, Asian etc. Given any combination of these people, I want to check if it is a diverse group.
A diverse group is a group that satisfies several requirements, ... |
Consider the following problem. Given a $m \times n$ integer matrix $A$ and a $p \times q$ integer matrix $B$, do there exist one-to-one functions
$$r:\{1,2,...,m\} \rightarrow \{1,2,...,p\}$$
$$c:\{1,2,...,n\} \rightarrow \{1,2,...,q\}$$
where for all $1 \leq i \leq m$ and $1 \leq j \leq n$, $A[i,j] \leq B[r(i),c(j)]... |
Suppose, I have an array of length 100.
I have 0s at some positions and 1s at some other positions.
What is the fastest method by which I can separate the 0s and 1s, so that we get all the 0s at the beginning and all the 1s at the remaining positions / vice-versa?
|
I'm working on a type system and hit upon a problem that seems similar to lowest common ancestor. Given two types, I need to find the smallest sequence of conversions which will result in the same target type. If I had a simple type tree I know how to get the result, but unfortunately I have a slightly more complex gra... |
This is a question from the Dragon book (I apologize for translation mistakes, I don´t have the English version on hand):
What language is generated by this grammar?
$S \rightarrow a S b S \mid b S a S \mid \epsilon$
I don't know what I'm supposed to do here. The definition in the book about languages says this (and... |
Suppose we're receiving numbers in a stream. After each number is received, a weighted sum of the last $N$ numbers needs to be calculated, where the weights are always the same, but arbitrary.
How efficiently can this done if we are allowed to keep a data structure to help with the computation? Can we do any better th... |
There is a sentence with N words.
The words are randomly shuffled.
I have a heuristic algorithm that tries to restore the original order.
I want to evaluate my algorithm on a dataset of several hundred long sentences from the internet.
The main goal of the algorithm is that humans looking at the restored sentence will... |
I can't wrap my head around how the SR Latch works.
Seemingly, you plug an input line from R, and another from S, and you are supposed to get results in $Q$ and $Q'$.
However, both R and S require input from the other's output, and the other's output requires input from the other other's output. What comes first the ... |
I'm trying to understand the theory of quantum computing, and I'm a bit confused on a particular circuit:
Would the controlled NOT gate be a type of measurement, causing Q1 to be either |0> or |1>, or would the circuit be in a superposition of the |00> and |11> states until an actual measurement of Q1 or Q2 took place... |
I'm doing a practice test for a course on routing problems. There's a question asking to infere the time complexity of the 2-opt method.
I can see that the complexity per iteration is in $O(n^2)$ because you need to check all combinations of 2 arcs. I don't know how to calculate the worst case number of iterations thou... |
Let
$A= \{L \mid L \;\text{is one-counter and \(\bar{L}\) is also one-counter} \}$
Clearly, $\text{Deterministic one-counter} \subseteq A$
Is it the case that $ A = \text{Deterministic one-counter}$?
I know that for context-free languages the analogue is not the case. For example,
let $P =\{ ww^r\}$.
Then both $P$ and... |
This is a question about recurrence relation that contains sum inside the recursion.I am totally stuck. Can anyone help?
The problem asks to solve the following recursion $T(n)=\frac{1}{n} \sum_{i=1}^{n-1}(T(i)+T(n-i))+cn$. The problem also warns that unwrapping is going to be the wrong approach and the right strategy ... |
I was reading about Universal Turing Machines.
I see that the matching lemma states, that between two symbols X and Y, if there are only 1-s and blanks, then a TM exists, which can count the number of ones.
This is used to match strings of ones between two tapes.
Now I wonder, would there also be a TM or a method of im... |
I was just reading from wikipedia the following about information:
From the stance of information theory, information is taken as a
sequence of symbols from an alphabet, say an input alphabet χ, and an
output alphabet ϒ. Information processing consists of an input-output
function that maps any input sequence fro... |
E.g.
Matching Problem The DFA of regex good is like a chain.
match: "good"
not match: "people do not give good comments are not good people"
Searching Problem The DFA used in searching regex good could be:
1 matching: "good"
2 matchings: "people do not give good comments are not good people"
Here are the questi... |
$L = \{ a^ib^j \mid j\neq i \ and \ j\neq2i \ \} $
Is this language a context free language?
If yes give a PDA. If no, give a proof.
The pumping lemma for context free languages doesn't seem to work here.
Let $p>1$ be the pumping length. Let the string be divided into five parts according to pumping lemma as $w = uvxyz... |
Given [[1,4,7],[2,5,8],[3,6,9]] which is a list of the column vectors of matrix
|1, 2, 3|
|4, 5, 6|
|7, 8, 9|
is $ \Omega(n^2) $ a lower bound for transposing? Assume the matrix is not always square. I have to touch each element at least once, because going from 2 x 5 to 5 x 2 matrix for example, will mean going from ... |
I've been self-studying the Expectation Maximization lately, and grabbed myself some simple examples in the process:
From here: There are three coins $c_0$, $c_1$ and $c_2$ with $p_0$, $p_1$ and $p_2$ the respective probability for landing on Head when tossed. Toss $c_0$. If the result is Head, toss $c_1$ three times, ... |
Unfortunately my background in computational complexity is still weak, but I am working on it.
As I understand, the question of existence of one-way functions is very important in the field.
Assume there are one way-functions, how it can be shown that there exist one-way functions which are length preserving?
|
In all computer architecture books we study that Cache memory could be divided into 3 levels (L1,L2 and L3) and its very beneficial to do so. Why don't we use the same approach in case of main memory (RAM). Is there any particular reason that we avoid this?
|
Sudoku is well known puzzle which is known to be NP-complete and it is a special case of more general problem known as Latin squares. A correct solution of the $N \times N$ square consists of filling every row and every column with numbers from $1$ to $N$ under the condition that every number appears exactly once in an... |
A class of languages $\mathcal{C}$ is closed under countable union (cucu) if for all series of languages in $\mathcal{C}$ ($(L_i)_{i\in\mathbb{N}} \in \mathcal{C}^\mathbb{N}$) the language $\bigcup_{i\in\mathbb{N}}L_i = \{x\mid \exists i\in\mathbb{N}: x \in L_i\}$ is an element of $\mathcal{C}$.
As we know most (if not... |
Inspired by this question in which the asker wants to know if the running time changes when the comparator used in a standard search algorithm is replaced by a fair coin-flip, and also Microsoft's prominent failure to write a uniform permutation generator, my question is thus:
Is there a comparison based sorting algori... |
I am a beginner in data structures and recently came across a vector implemented on an array, which is extended on demand. Of course the table cannot be extended "in place", we must allocate a new array, then copy elements from the previous one which is a linear operation itself (invoked log(n) times, where n is the nu... |
When dealing with the analysis of time and space complexity of algorithms, is it safe to assume that any function which has tight bounds ( i.e. $f(n)=\Theta(g(n))$ is asymptotically positive and asymptotically monotonically increasing. I mean that for all $n$ greater than or equal to some $n_0$ both those properties h... |
Why is $A(L) = \{x \in L \mid x = x^R \}$ context-free if $L$ is a regular language?
Trying to understand the approach to determining whether a regular language is context-free.
|
There is a land divided to $D$ districts.
There are $C$ citizens.
We want to divide the land to the citizens, such that each citizen receives a single land-plot in a single district.
Each citizen prefers certain districts, however, the preference also depends on the size of plot. For example, Johnny prefers a plot of 1... |
This is inspired by an interview question.
We are given an array of integers $a_1, \dots, a_n$ and have to determine if there are distinct $i \lt j \lt k$ such that
$a_k - a_j = a_j - a_i$
$k - j = j - i$
i.e, the sequences $\{a_i, a_j, a_k\}$ and $\{i,j,k\}$ are both in arithmetic progression.
There is an easy $O(n^... |
Say I want to find the n-th prime. Is there an algorithm to directly calculate it or must I do with sieving? I know always calculate the next prime with a sieve principle, but what if I want the n-th prime?
Duplicate:
https://math.stackexchange.com/questions/1257/is-there-a-known-mathematical-equation-to-find-the-nth-p... |
I need to find a minimal DFA given the following information:
$ \{a^nb : n\geq 0\} \cup \{b^na: n \geq 1\}$
Now, maybe I'm not seeing this properly, but I don't see how this is possible: the first one will take 0 or more a's followed by one b, whereas the second one will take a 1 or more b's followed by one a.
Drawi... |
Define the problem $W$:
Input: A multi-set of numbers $S$, and a number $t$.
Question: What is the smallest subset $s \subseteq S$ so that $\sum_{k \in s} k = t$, if there is one? (If not, return none.)
I am trying to find some polytime equivalent decision problem $D$ and provide a polytime algorithm for the non-deci... |
How are these Context-Free Pumping Lemma Approaches differ?
Maybe this might help understand pumping lemma better
$(a^{i}b^{i}c^{j}d^{j} \mid i, j \geq 0$}
$(a^{i}b^{j}c^{i}d^{j} \mid i, j \geq 0$}
$(a^{i}b^{j}c^{j}d^{i} \mid i, j \geq 0$}
I understand we use contradiction with these conditions
$|vwx| \leq p$
$|vx| \g... |
I'm looking for resources on getting started with program analysis.
The only book I've found on the topic is the Nielson & Nielson book.
Other than that, it seems like there are only "compiler" books where "program analysis" would be a chapter, or something along those lines.
Do people know of any other resources?
|
In a circular linked list, if an elements needs to be inserted at front [just before the node pointed by head], can be done in O(1) (see the answer here)
But in a book currently, I have, it is mentioned that it is done in O(n) (the usual method). I also saw few lecture ppts, they all mention the usual method of travers... |
So I'm trying to understand P/NPC problems. The one I'm trying to tackle now is subset sum (we have a collection of integers $S$ and a $k$ param: is there a subset of $S$ that sum of all it's elements is equal to $k$?) problem and the proof that ss is an NPC problem by reduction from 3SAT.
I've found two PDF's that at... |
Perhaps this is a question for stackoverflow because its practical nature, but I am not aware of any general method to relate recurrence relations and recursive functions.
Having as an example this recurrence relation:
$\qquad \begin{align}a_0 &= a_1 = 1 \\ 2a_n &= 3a_{n-1}-2a_{n-2}\end{align}$
I would like to transfor... |
I have recently came across half-adders and full adders in my Logic Network lectures. I have somewhat understood the theory, but I am still unable to understand the reason why they called them in that name? I mean, is there any reason why half-adders have the name ‘half-adders’?
|
I need an efficient algorithm that takes input a collection of intervals and outputs the largest subset of non-intersecting intervals.
i.e. Given a set of intervals $I = \{I_1, I_2, \ldots, I_n\}$ of the real line, we need to output a set of intervals $O = \{O_1, O_2, \ldots, O_k\}$ such that
$O$ is a subset of $I$.... |
Just a quick question,
If i were to alter the general DFS algorithm to do this:
minDFS(Vertex v)
{
if (!v.getVisted())
{
v.setVisited();
Vertex temp = findClosestVertex();
graph.addEdge(v, temp);
minDFS(temp);
}
}
Would I eventually (at the end of DFS) get minimum spanning tree? I... |
I understand that destination-based routing builds the "route" from the destination backwards to the source (e.g. if using a spanning tree, then the tree is routed at the destination). With source-based routing the opposite is true: the route is build from the source onwards towards the destination.
However I don't und... |
Definition: A preserved invariant of a state machine is a predicate, $P$, on
states, such that whenever $P(q)$ is true of a state, $q$, and $q \rightarrow r$ for some state, $r$,
then $P(r)$ holds.
Definition: A line graph is a graph whose edges are all on one path.
Definition: Formally, a state machine is nothing mor... |
Why do most programming languages (if not all) lack a 2-bit data type?
A boolean is a single bit with the values being either true or false.
Why is there no native, corresponding type where the values can be either true, false, neither or both? This data type can of course be constructed inside the language, but I figu... |
Assume there was a database system that had a data type called VARINT or some variant that allowed instead of fixed-length INTs regardless of value, a 1 would only take 1 BIT (1), 2 would take 2 BITs (10), etc.
In this perfect world, a VARINT could be used to autoincrement a PRIMARY column. However, there's still the ... |
Suppose all costs on edges are distinct. How many minimal spanning trees are possible?
I dont know if this question is supposed to be easy or hard, but all I can come up with is one, because Kruskal's, and any other greedy algorithm should choose all the smallest weighted edges first. Then, if all weights on all edges ... |
I have this question:
Input:
G(V, E) = an undirected graph, V={v1, v2, ..., vn} (V = set of nodes, E = set of edges)
where there is a path connecting from v1 to vn.
Question:
What is the maximum number of nodes you can visit when starting from v1 and ending at vn.
(including v1 and vn)
Each node can only be visite... |
Recently, I asked a question on Math SE. No response yet. This question is related to that question, but more technical details toward computer science.
Given two DFAs $A = (Q, \Sigma, \delta, q_1, F_1)$ and $B = (Q, \Sigma, \delta, q_2, F_2)$ where the set of states, the input alphabet and the transition function of $... |
There are 3 processors: $P_1$, $P_2$, $P_3$. $P_1$ can execute only one job while the other two can execute any number of jobs in parallel.
Each job consists of 3 parts, and each part is processed by their respective processor (eg. part 1 by $P_1$). Furthermore part 2 can be executed only after $P_1$ finishes executing... |
I am facing problem in understanding the KMP algorithm as given in the book "Introduction to Algorithm" by Cormen et. al. (Chapter 32):
With respect to the above algorithm, I have following question:
In both the algorithms, where exactly (which line number?) while loops, if and for loop ends? It is difficult to vi... |
I have this problem which is described as follows:
Input:
You are given a multi-set $M$ (a set that can contain duplicates), and two numbers $P$ and $T$.
$M = {(x_1,y_1), (x_2,y_2), ..., (x_n,y_n)}$.
Each $x$ and $y$ is an integer $>= 0$.
$P$ in an integer $>= 0$.
$T$ is an integer $> 0$.
Question:
... |
Suppose I have a graph $G$ with $M(G)$ the (unknown) set of perfect matchings of $G$. Suppose this set is non-empty, then how difficult is it to sample uniformly at random from $M(G)$? What if I am okay with a distribution that is close to uniform, but not quite uniform, then is there an efficient algorithm?
|
If you have a forest implementation of disjoint sets, and have the union by weight/rank heuristic where you append the smaller one. Then why is the worst case running time Θ(m log n)? (m is the number of disjoint sets and n is the number of Make Set operations.)
|
How can someone synchronize two or more threads using serialization? According to my professor's slides and code assignments you can use serialization to solve the synchronization problem. (He doesn't explain what serialization is).
I tried to do my research but serialization means that you put data in a specific order... |
Can anyone suggest an algorithm faster than $\Theta(n^{2})$ for computing the following function:
$$||n||:=\frac{1}{\max\{k \in \mathbb{N}: 1|n, 2|n,\ldots,k|n\}}$$
|
The worst case running time of insertion sort is $\Theta(n^2)$, we don’t write it as $O(n^2)$.
$O$-notation is used to give upper bound on function. If we use it to bound a worst case running time of insertion sort, it implies that $O(n^2)$ is upper bound of algorithm no matter what type of input is, means it doesn’t m... |
I have a question have to answer, so that, if anyone have the answer, please help me.
The problem is: Give a self-contained proof that $\mathsf{L} \neq \mathsf{PSPACE}$
where:
$\qquad \mathsf{L} = \{ L \mid L \text{ is a language decidable in logarithmic space} \}$ and
$\qquad \mathsf{PSPACE} = \{ L \mid L \text... |
I was wondering, since $a^*$ is itself a star-free language, is there a regular language that is not a star-free language? Could you give an example?
(from wikipdia) Lawson defines star-free languages as:
A regular language is said to be star-free if it can be described by a regular expression constructed from the le... |
There are many NP-complete decision problems that ask the question whether it holds for the optimal value that OPT=m (say bin packing asking whether all items of given sizes can fit into m bins of a given size).
Now, I am interested in the problem whether OPT>m. Is this a decision problem or an optimization problem? It... |
It is said that there are uncountably many languages but only countably many Turing Machines. Could someone make this clear to me?
And this doesn't mean that the set of TM is finite, yes?
|
I'm thinking about a routing system. Imagine I have the two following regexes
pathpart1/pathpart2 => specific match that routes to controller1
.* => catch-all that routes to controller2
And I let them match on a URL, e.g. 'pathpart1/pathpart2'.
They both match, but I would want to give prevalence to the most specific... |
I have an assignment to construct a game of Nim (a game in which two players must divide a pile of tokens into two unequal sizes; 6 can be divided into 2 & 4 but not 3 & 3). I was provided a game tree (the same one I find on Google), but I am confused. Shouldn't the first turn of the second player have access to S6, S5... |
I have a problem where I am supposed to analyze the Steiner tree problem by doing the following 3 steps.
1) Look up what the Steiner tree problem is.
2) Find a polynomial time reduction to it from one of these 8 known NP-complete problems:
3-col
subset-sum
clique
hampath
Uhampath
sat
3-sat
vertex-cover.
3) Pro... |
I need help with the following problem:
Input: An undirected, unweighted graph $G = (V,E)$ and a set of vertices $F \subseteq V$.
Question:
Find a vertex $v$ of $V$ such that the distance from each vertex of $F$ to $v$ is the same and all the distances are minimized? Return None if there is no such $v$.
The runti... |
I am finding it difficult to clearly differentiate between Multiprogramming and Multitasking.
My primary source has been Wikipedia, but the WP article seems to be a little at odds with some less reputable sources (like my college professor).
As I read WP, multiprogramming is a rudimentary way of increasing CPU throughp... |
What does it mean when we say that a run of Prim's algorithm is trivial? What are example graphs for either case, that is with and without trivial runs?
|
$3$-$\mathrm{Partition}$ problem is $\mathsf{NP}$-Complete in a strong sense meaning there is no pseudo-polynomial time algorithm for it unless $\mathsf{P=NP}$. I am looking for the fastest known exact algorithm that solves $3$-$\mathrm{Partition}$.
Is there a fast (e.g subexponential) algorithm for $3$-$\mathrm{Partit... |
I am trying to determine the worst case runtime of this program:
while n > 1
for i = 1,..,n
m = log(n)
n = n/2
Obviously the outer loop runs log(n) times, because n is halfed after each step.
But the inner for loop is dependent on the decreasing n and I am not quite sure how to deal with that.
A simple bound f... |
I have come across about RS Flip Flop & I have tried implementing that on a simulator & using actual logic gates. But I'm still not sure whether I have correctly understood the case unstable or the forbidden case S=1, R=1 in Flip flop. Can anyone tell me what exactly is that?
By the way I have used 2-INPUT NAND Gates t... |
In the original paper of A* algorithm, A Formal Basis for the Heuristic Determination of Minimum Cost Paths, the author proved the optimality of A* in Theorem 2, page 105.
However, I cannot understand the proof. The assumption is that we have a node in $G_s$ which is not expanded by algorithm A, but in the proof we cha... |
I'm doing a self-study of Game Theory Evolving by Gintis, and am stuck on problem 4.16 "Poker with Bluffing".
The first question asks "Show that Ollie has 64 pure strategies and Stan has 8 pure strategies.". But no matter how I try to approach this, I can't get more then 4 strategies for Stan!
Here is the game tree for... |
I have an undirected tree whose vertices I want to label. The leaf nodes should be labeled one. Then, assume the leaves were removed. In the tree that remains, the leaves should be labeled two. This process continues in the obvious way until all vertices have a label. The reason I do this is I want to store the vertice... |
I am writing a program to store, retrieve and delete "blocks" of data of varying sizes.
The way it currently works is by keeping a database storing the locations of the blocks and the locations of free space in the file.
The file is split into pages such that in each page there are no two free chunk spaces next to each... |
I have came across a weird experience in C programming. Consider this code:
int main(){
int array1[6] = {0, 1, 2, 3, 4, 5};
int array2[6] = {6, 7, 8, 9, 10, 11};
printf("%d\n", array1[-1]);
return 0;
}
When I compile and run this, I don't get any errors or warnings. As my lecturer said, the array index -1 acc... |
I am supposed to write a Context free grammar that generates the language:
$\qquad L(G) = \{0^{3n}1^{2n}0^{m}1^{m} : n \ge 1, m \ge 1\}$
I have the rules:
$$S \rightarrow 000S$$
$$S \rightarrow S11T$$
$$T \rightarrow 0T$$
$$T \rightarrow T1$$
This looks correct in terms of the structure of the grammar but I am not sure... |
I want to know if the following problem is decidable:
Instance: An NFA A with n states
Question: Does there exist some prime number p such that A accepts some string of length p.
My belief is that this problem is undecidable, but I can't prove it. The decider can easily have an algorithm to figure out if a particular n... |
I have two regular languages A and B, and I want to determine whether there is any pair of strings, a in A and b in B, such that (a b) is a prefix of a string in (A B) and the left-most match of B in (a b) includes one or more characters from a.
Raphael's formulation is good:
Given two regular language A, B, is there ... |
I'm reading my textbook and it claims that the regular expression $c^*(b \cup (ac)^*)^*$ defines the language $L$ over $\{a,b,c\}$ which consists of all strings that do not contain the substring $bc$.
However, I'm failing to see how that language would contain strings such as $bbbaaa$ or $aaabbb$. Am I missing somethi... |
I have been given a question about a stack program which I can not solve.
Write a stack program to evaluate the term
$\qquad (((A+B)-(A*B))*C)/(((A-B-C))⁄2)$
How do I approach this problem?
|
Suppose we are given $n$ variables $X_i, i=1,\dots,n$, each taking values from $\{0,1\}$, and a constant integer $k$ with $ 0\leq k \leq n$.
What are some efficient ways to enumerate all possible combinations of values of $X_i$'s subject to the constraint $\sum_{i=1}^n X_i = k$?
A naive way is to first enumerate one by... |
In many papers I've read that it is well known that the Shannon entropy of a random variable can be converted to min-entropy (up to small statistical distance) by taking independent copies of the variable.
Can anyone explain to me what exactly this means?
|
I have to implement a limitation algorithm in order to avoid to reach a throughput limit imposed by the service I'm interacting with.
The limit is specified as «N request over 1 day» where N is of the order of magnitude of 10^6.
I have a distributed system of clients interacting with the service so they should share th... |
Given $n$ jobs $J_1,J_2,...,J_n$, each job requires $T_i > 0, T_i \in N$ time to complete.
Each job must be pre-processed and post-processed by a single machine M that can handle only 1 job at a time and both phases require 1 unit of time. After being pre-processed, job $J_i$ is sent to a machine with unlimited power (... |
I was looking at the pumping lemma for CFG. I came across the first problem $a^nb^nc^n$ and understood the answer. Then I thought of the problem $a^nb^n$. I know that this is context free and thought of applying it. I came across a weired situation. Someone please tell me where I went wrong.
So our language is $a^nb^n... |
I could find that different texts follow different steps in the conversion of CFG to Chomsky Normal Form. I couldn't find any presumptions they made in the conversion steps. I have some questions regarding the conversion.
Most text books tell us about only two rules $A \rightarrow BC$ and $A \rightarrow a$. But some t... |
I am interested in procedures for fair division of land (i.e. envy-free division, or at least proportional division).
In contrast to the well-studied cake-division problem, land-division is two-dimensional, i.e., the preferences of the users may vary both horizontally and vertically. Therefore, it is not practical to l... |
Earlier I asked the question: Can a Turing Machine decide if an NFA accepts a string of prime length?. The answer introduced me to Parikh's theorem, which I've been reading about. The concept of Parikh's theorem, if we apply it to regular expressions, allows us to break down a regular expression into expressions that o... |
Here is a DFA from a research project. We created the DFA manually.
We are interested in which regex is this DFA corresponding to.
Certainly, there could be multiple regex corresponding to it; we prefer a simpler one.
Inspired by the first answer from Karolis Juodelė, one correct Answer should be:
(00*10*1|1(0*|(10)*)... |
I have a hard time understanding the following lines from our lecture notes:
$f \in \text{FP}$ iff there is a transducer T that computes $f$ and there exists a polynomial $p$ such that $TIME(T(x)) \leq p(|x|).$
Note: If $f \in \text{FP},$ then $|f(x)| \leq p(|x|)$ holds for a fixed polynomial $p.$
Examples:
$f(x) = x^... |
Given $n$ arrays of size $k$ each, we want to show that at least $\Omega(nk \log k)$ comparisons are needed to sort all arrays (indepentent of each other).
My proof is a simple modification of the decision tree argument used to obtain the lower bound for comparison-based sorting of one array. More specifically, I argu... |
Let $B = G(L, R, E)$ be a bipartite graph. I want to find out whether this graph has a perfect matching. One way to test whether this graph has a perfect matching is Hall's Marriage Theorem, but it is inefficient (i.e $|\mathcal P(L)| = 2^{|L|}$ tests -- not polynomial). I can always find out whether a perfect matching... |
Can a two-stack PDA accept language $L=\{a^nb^mc^nd^m \mid n \geq m\}$, which has no context-free grammar?
I don't believe this has a context-free grammar, but please correct me if I'm wrong.
|
I am reading Computer Architecture & Organization by William Stallings to understand I/O operations. Stallings pretty well explains why Programmed I/O (CPU keeps checking the I/O module register status) & Interrupt I/O (CPU still has to over look data transfer between I/O module & memory) are not efficient & introduces... |
Let $$L_\emptyset = \{\langle M\rangle \mid M \text{ is a Turing Machine and }L(M)=\emptyset\}.$$
Is there a Turing machine R that decides (I don't mean recognizes) the language $L_\emptyset$?
It seems that the same technique used to show that $\{A \mid A \text{ is a DFA and } L(A)=\emptyset\}$ should work here as well... |
I have $n\times k$ matrix with $k<n$ and I would like to find all its $n\choose k$ submatrices which are $k\times k$ matrices that are the concatenations of all possible $k$ rows. Actually I tried to do it with Matlab but it takes too long time specially when $n>20$ and I couldn't find a way how to generate in parallel... |
Do you know of any kind of decomposition of graphs that involves centers, especially in the context of parametrized complexity? If so, please provide some reference. If not, do you see any reason (other than the potentially large size of centers) why such a notion isn't fruitful (e.g. subsumed by other notion)?
I'm loo... |
Here is the problem: we are given vectors $v_1, \ldots, v_k$ lying in $\mathbb{R}^n$ which are orthogonal. We assume that the entries of $v_i$ are rational, with numerator and denominator taking $K$ bits to describe. We would like to find vectors $v_{k+1}, \ldots, v_n$ such that $v_1, \ldots, v_n$ is an orthogonal basi... |
We can write a decider for the language:
$E=\{A\; |\; A \mbox{ is a DFA and } L(A)=\emptyset\}$
by marking method. Why we cannot use the same method to write a decider for the language with TM as follows?
$A = \{ M \;|\; M \mbox{ is a TM and } L(M)=\emptyset\}$
|
In the case of LBAs (Linear Bounded Automaton), in writing a decider for the language
$\qquad A = \{ \langle M,w\rangle \mid M\ \mathrm{LBA}, w \in \mathcal{L}(M) \}$
we reject the input after a specific number (number of possible different configurations) of computation steps.
We say that the machine must be looping a... |
This question is on the GRE Computer Science test booklet (not homework). I tried applying closure properties of regular languages but no success.
Suppose $L$ is a regular language over $\Sigma = \{0, 1\}$. Show that the language
$\qquad L' = \{w \in L \mid |w| \in 2\mathbb{N}\}$
is also regular.
What I find surprisi... |
My problem with CFG is, I am to generally create ones that don't have requirements such as:
$\qquad \{a^m b^n \mid m \le n \le 2m \}$
I have no clue where to begin, and how to approach it. I was wondering if you can provide some hints for such daunting problems, along with how to solve that problem.
This is not homewor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.