instruction stringlengths 35 29.1k |
|---|
Let an infinite language, $L$, which contains only TM which halt for every input (meaning, decides some language). Is $L$ in $R$ ? in $RE \setminus R$ ?
I've understood that the answer is: it depends on what exactly $L$ is.
So basically I'm trying to think of two scenarios for $L$ - one which $L\in R$ and one which ... |
Is Tarjan's algorithm capable of finding satisfying assignment to any digraph consists of variables (vertices) and implications (edges)? I know that it solves implication graphs constructed by 2SAT clauses, but I wonder if the algorithm can handle the digraphs which cannot be expressed as 2SAT clauses. Let me clarify t... |
Given a homomorphism $h: \Sigma \rightarrow \Delta^*$ such that e.g. $\forall a \in \Sigma: h(a) = \delta$, where $\delta \in \Delta$ (i.e. all symbols from the alphabet $\Sigma$ have the same image $\delta$), is the inverse homomorphism $h^{-1}$ a homomorphism?
Since a homomorphism maps every symbol of the input alpha... |
Let the class of languages $$X = \{ L \ | \ L\in NPC \land L\in coNPC\}$$
Why is it true that $NP \ne coNP \implies X = \emptyset$?
|
The problem
I have two integers, $n$ and $p$:
$n \ge 1$
$1 \le p \le 2^n + 1$
Consider the sequence of numbers: $0, 1, 2, ..., 2^n, 2^n + 1$.
$0$, $p$, and $2^n + 1$ in the sequence are marked as deleted.
I need an algorithm that can mark all the elements of the sequence as deleted , in k steps (k from 1 to n), with th... |
$A_{TM} = \{<M,w> | $ M is a TM and M accepts w $\}$
$H_{TM} = \{<M,w> | $ M is a TM and M halts on w $\}$
I thought that $L = H_{TM} \cap \overline{A_{TM}} \in R$
But I saw the proof for why $L \in RE \setminus R$
But I don't understand why this is wrong:
$H_{TM} \in RE$ and $\overline{A_{TM}} \in Co-RE $
We know th... |
I have found various opinions saying they are (a link to one is given in D.W.'s comment). However, a proof that DCFLs themselves are not closed under concatenation found here on StackExchange seems to be applicable also to concatenation with regular languages:
Pick the languages:
$L_1 = \{a^ib^jc^k | i \neq j \}$ and ... |
You are given a bunch of nodes evenly spaced in a rectangular grid. The rectangle is M nodes long and N nodes wide. Node A is in the upper left hand (northwest) corner and node B is at the bottom right hand corner (southeast). From each node you can only move east, south, or diagonally southeast to the next adjacent no... |
A debate has arisen in the course of using an assembler (which does a bit of preprocessing first, but is mainly a static assembler):
This particular assembler allows recursive macros to be defined, which it then attempts to resolve (statically, at compile time) and embed in the binary output.
The question is, does this... |
To store say integers (positive), we prefer to use red black BSTs. I have never seen a explicit use of a trie anywhere to store numbers.
I believe we can convert numbers to string and store them in tries for fast retrieval.
Is it a bad idea to use tries?
We don't use them because they are hard to code and there are lib... |
I can't see how I can apply quantum function $a^x\mod N$ to initial states. Explanations of Shor's algorithm often skips this part, and I do not see what unitary matrix this algorithm would correspond to.
reference: https://en.wikipedia.org/?title=Shor%27s_algorithm
|
A problem $L$ is NP-complete when:-
$L\in \text{NP}$
For every problem $L' \in \text{NP}$, $L'$ is polynomial time reducible to $L$
When at least property 2 is satisfied for a problem $L$ (but not
necessarily property 1), then $L \in \text{NP-Hard}$.
When a problem $L\in \text{NP-Complete}$ is shown to have a polyn... |
I'm in doubt about that because in Google's results for a search on "bill clinton" [1],
the server "The 'Unofficial' Bill Clinton" (94.06%) appears first than the server "President Bill Clinton - The Dark Side" (97.27%) and there is no feedback mechanism modifing the ranks.
Since I've noticed that, I am wondering if go... |
I've recently become interested in randomly generating Voronoi diagrams to create "territory" maps (similar to this) for a project I've been working on.
Traditional Voronoi diagrams using an Euclidean metric don't present sufficient cell variation for my liking so I've been attempting to utilize a L∞ metric instead, ... |
According to the concepts of Pipelining,
In a single cycle different stages of different instructions are
executed.
Now I have a bit of confusion here, that if a single processing element is there and can perform one processing at a time ,
then -
Do the preemption occurs multiple times in a single cycle in order to c... |
Assume we have a $n$ sized integer array $A$, and that we know that $\sum_{i\in[n]}A[i] \le M$.
Assume we are using the RAM model with $\Theta(\log n)$ sized memory words (which can be read / written in $O(1)$ time), and that $M=n^{O(1)}$.
A standard implementation could allocate $\lceil \log_2 M\rceil$ bits per cell, ... |
Consider the languages $B,C,D$, such that $B\le_p C$ and $B\le_p D$.
Statement: $B\in P, D\in NP, C\in coNP$.
Is the statement true for every $B,C,D$?
I know that the answer is no and I have tried to come up with a conunter-example.
I thought about taking $D\in NPC$ or $C \in coNPC$ but that didn't yield anything goo... |
I'm sure someone has thought about this before or immediately dismissed it, but why does Schaefer's dichotomy theory along with Mahaney's theorem on sparse sets not imply P = NP ?
Here's my reasoning: Create a language $L$ which is equal
to SAT intersected by an infinite decidable sparse set. Then $L$ must also be
... |
I'm practicing an exam for a data structures course. There's a question about a hash table with hash function:
$$h'(k,i)=h_1(k)+i*h_2(k) \mod{11}$$ where
$$h_1(k)=k \mod{13}$$ and $$h_2(k) = 1 + k \mod{7}$$
There's a question:
What problem will occur if we change the table size to 12 and we also change the module in $$... |
The prime-counting function, demoted $\pi(x)$, is defined as the number of prime numbers less than or equal to $x$.
We can define a decision problem from $\pi(x)$ as follows:
Given two numbers $x$ and $n$, written in binary, decide if $\pi(x) = n$.
A friend and I were talking about this problem earlier today. There's... |
I mean, say we want to show how we can implement an OR gate in terms of a NAND gate. If we write in Polish notation, then we've suggested that the circuit takes the gates before the inputs. If we write it in infix notation, we've suggested a mix. But if we write ppDqqDD, then we've suggested that we have the input 'p',... |
I'm using Thompson's algorithm to convert from a regular expression to a NFA. Is Thompson's algorithm guaranteed to always output a minimal NFA, i.e., a NFA with the smallest possible number of states?
For instance, consider this example. I have the regular expression $(a|b)$. According to this website, Thompson's a... |
Why do differential-privacy people care whether or not the noise function saturates the lower bound of Shannon entropy?
For example :
Laplace distribution that is used to model the noise function happens to saturate the lower bound of Shannon entropy under epsilon differential privacy constraints. See Theorem 8 in Yu... |
I am solving a large (~1e5 equations & unknowns) set of nonlinear equations using Newton-Raphson iterations. Currently I am using the GPU accelerated Krylov methods implemented in ViennaCL to solve the linear system to get the update increment. I am solving the system on a single 24 core, 64GB workstation with a NV... |
I've tried to solve a exercise 4.1-5 in algorithm book "Introduction to algorithms".
it is about Maximum sub-array problem, which is an algorithm that determines the greatest sum of sub-array A[i], A[i+1] , ... , A[j] in given array A[1] , ... , A[n].
The exercise is about developing linear-time algorithm to solve th... |
there is some kind of priorities for the elements in propositional logic ?
for example : p ∧¬q → r , given this ,we there may be two options
(p ∧¬q) → r OR p ∧ (¬q → r) , which one is the correct ?
|
Assuming $P\neq NP$, is it possible that there exists a $k$ such that $P\subseteq\textsf{NTIME}(t^k)$?
There reason I ask this is that I assume the following:
$$P=NP \implies \forall k\ \exists j.\ \textsf{NTIME}(t^k)\subseteq\textsf{DTIME}(t^j)$$ but I know that these statements are not exactly contrapositive to each ... |
I give you a list of $n$ bitvectors of width $k$. Your goal is to return two bitvectors from the list that have no 1s in common, or else to report that no such pair exists.
For example, if I give you $[00110, 01100, 11000]$ then the only solution is $\{00110, 11000\}$. Alternatively, the input $[111, 011, 110, 101]$ ha... |
/!\ I am not speaking about int or float, my question is about model of computation used to design and describe algorithms.
The integer numbers case
Many algorithms use integers and their complexities are almost always given using both the RAM model and the big $O$ notation.
Using the RAM model allows us to add 2 integ... |
Given a sequence of $2 \leq n \leq 50$ numbers $s = (s_1,s_2,...,s_n)$, find a permutation $a = (a_1,a_2,...,a_n)$ of $s$ such that $$\sum_{i=1}^{n-1} |a_i - a_{i+1}|$$ is maximized.
I found many codes that get "Accepted" in the online judge with the following greedy algorithm.
If $n = 2$, then $a = s$. Stop the algor... |
Given some function and assuming no concern for the time to compute the co-domain for its domain, when might it be preferable to compute and tabulate in advance the co-domain results of the function, and then retrieve it from the table rather than compute it?
For example, if the domain for $f(x)=x^2$ were sufficiently ... |
Canny edge algorithm has 5 stages, from here
1. Apply Gaussian filter to smooth the image in order to remove the noise
2. Find the intensity gradients of the image
3. Apply non-maximum suppression to get rid of spurious response to edge detection
4. Apply double threshold to determine potential edges
5. Track edge by h... |
Suppose tomorrow someone discovered a proof that P = NC. What would the consequences for computer science research and practical applications be in this case?
|
Lets suppose that 20 percent of the instructions in a program are branch instructions.The static prediction of the jumps supposes that the jumps don't happen.
I should find the execution time in two cases : When 30 percent of the branches happen and when 70 percent of the branches happen I also should find the speedup ... |
Suppose that $[U] = [0,...,U-1]$ is the universe from which all elements will be taken, and $A$ a hash table of size $m$.
A hash function $h:[U]\rightarrow[m]$ is truly random if
For any set of distincts elements $\{x_{1},...,x_{k}\} \subseteq [U]$ and any set of values $u_{1},...,u_{k} \subseteq [m]$ we have $Pr_{h}... |
I am trying to prove that
$\qquad L=\{\langle M\rangle \mid M \text{ is a TM }, \exists w. \text{ in } M(w) \text{ the head moves only right and } M(w)\!\uparrow \}$
is decidable.
I thought about the following solution:
Lets build $\hat{M}$, a TM that will decide L:
M on input $\langle N \rangle$:
1. $\Sigma^{Q+1} $... |
We all know that for insertion() operation in AVL tree following can happen:
We traverse down the tree from root to appropriate node and there insert the key and then for maintaining height balance we have to check heights of the ancestors of the newly inserted node and in doing so, we could end up traversing up to the... |
I have seen proofs of Ladner's theorem which detail the construction of languages in NPI assuming P $\neq$ NP. However, I was wondering if there are any other constructions using the fact that sparse sets cannot be NP-complete assuming P $\neq$ NP (Mahaney's Theorem). Specifically, is it definite (assuming P $\neq$ N... |
I know that if one-way functions exist then there are certain universal one-way functions that exist, but to my knowledge they are too impractical to implement (which is the main reason why they are not being used in modern cryptographic protocols). However, if one-way functions exist are the modern implementations (l... |
If I understood correctly, Hamming codes assume the uniform correction among all the bits. This means all the bits have the same weight in terms of correction.
Are there any error correcting codes out there that assume non-uniform error correction probability among the bits? For example, I want a error correcting code ... |
I just learned about recurrences and I just can't solve this problem. I have this recurrence relation:
$$
T(n) = \begin{cases}
k\cdot T(\frac{n}{k}) & n > 0\\
1 & n = 0\\
\end{cases}
$$
where $k$ is a constant number.
I tried drawing a recurrence tree or replacing for lower $n$s but no success. I hope you can help me w... |
Let the language $$L = \left\{ \langle G \rangle \ |\ L(G) = \{1,\ldots , 1000\}, \text{ G is a CFG }\right\}$$
Prove that $L \in R$.
Well, I think that for a start we need to check whether or not $L(G)$ is infinite, so we only need to check if there's a word $w\in L(G)$ such that $n \le \left|w\right|\le 2n$
Suppose... |
Several papers(1 (originator), 2, 3) suggest the use of Hierachical Softmax instead of softmax for classification where the number of classes is large (eg many thousand).
I haven't been able to get clear in my head what this means the actual final layer and output/labels of the neural network are.
For (plain) softmax t... |
Lets say we have a graph $G$ with $|V|$ nodes. We wish to select $k$ such nodes while optimizing the following attribute:
maximize: for each $i$ and $j$, where $i \neq j$, $min(distance(v_i, v_j))$
Hope that makes sense. We'd like to pick $k$ nodes such that the distance between the closest pair of distinct nodes is ... |
One of the surprising aspect of the genome for lay-people is that it
contains important non-coding DNA parts, which does not mean that they are
all useless. I never paid so much attention to the fact, until very
recently, when I realized that the same is apparently true of all
computing formalisms I can think of ... bu... |
I have followed two famous book on "Automata and Formal Language Theory":
Micheal Sipser's book
Jeffrey Ullman and John Hopcroft's book
in both books, tuple level definition of Turing machine differs with each other. Although abstract level working are same but details are different. Why there is not any standard def... |
I'm trying to map a 12 digit number into a fixed width file. For a number of reasons, it must be compressed in such a way that it is guaranteed to be less than or equal to 9 characters (alpha numeric is fine). My first thought was a change of base, but I can't find an equation which gives an upper bound the number of... |
First of all, I have to mention that I am very new in the field of information theory.
I have a question regarding the Shannon Entropy calculation for binary values. As far as I understood, the main assumption in the Shannon Entropy formula is that all the bits have the same weights. However, I am looking for a formula... |
I just can't solve this problem, I'm new to reccurences. I have this recurrence
$T(n)=n*T(n-1)$
$T(1)=1$
The second term will be:
$T(n-1)=(n-1)*T(n-2)$
And so on.
It's complexity is O(n!) but i don't know how to solve it.
I hope you can help me with an idea!
|
We suppose that the sets $S_1$ and $S_2$ are constructible enumerable, that means that there is an algorithm that enumerates them. Show that the sets $S_1 \cup S_2$ and $S_1 \times S_2$ are also constructible enumerable.
To show this do we have to construct a Turing machine for the union and one for the cartesian prod... |
Does anyone know of an accessible introduction to Cobham's model independent characterization of FP and it's equivalence to the standard definition using Turing machines? The best source I could find on-line was https://www.cs.toronto.edu/~sacook/homepage/ptime.pdf : a paper by Stephen Bellantoni and Stephen Cook deta... |
So, could a computer count to infinity assuming it was a super computer and had near unlimited amounts of ram and hard drive/solid state drive storage? I am being serious when I ask this.
[This is what I am asking]: Wouldn't Infinity mean endless counting, and wouldn't that be infinity?
|
I know what computation is in some vague sense (it is the thing computers do), but I would like a more rigorous definition.
Dictionary.com's definitions of computation, computing, calculate, and compute are circular, so it doesn't help.
Wikipedia defines computation to be "any type of calculation that follows a well-... |
In his commentary on a case involving pornography in 1964, U.S. Supreme Court Justice Potter Stewart sidestepped the question of defining what it meant for a work to be pornographic, but then said "I know it when I see it." It struck me that this was a pretty good description of recursive enumerability (recognizability... |
I am taking a compiler MOOC online on my own time. The class is self paced. There is a question with an answer but I can't understand why the answer is correct.
Here is the question.
For any language $L$, the complement of the language (usually written
$L′$) is defined as the language that consists of all the strings ... |
The Original Knuth's Algorithm is based on DFA and it depends on the alphabet size. And Then, Pratt optimised it to be independent of Alphabet Size.
But, All the textbooks directly give the final Pratt Algorithm. Below is the code ( the code is not really needed to answer the question) which is more or less similar to... |
I'm taking a Compiler MOOC on my own time. The class is self paced. An answer was given to a question but I can't understand the answer. In fact I'm not even sure how to interpret the question.
Here is the question:
Given the following lexical specification:
$(00)^*$
$01^+$
$10^+$
Which strings are NOT successfully pr... |
I'm implementing a chess engine.
Like many engines, the search for the next best move is done with the alpha-beta algorithm. There are many improvements that can be made to make the algorithm faster and make it able to search deeper into the search tree.
I'm currently considering Iterative Deepening for move ordering s... |
Yesterday while returning home, I walked past a house that had a camera. For some reason I started thinking about how these cameras work, and how you would use them in case of robbery. While thinking about everything that might happen in case of robbery, one problem came into my mind and it can be described as follows.... |
Given $n$ boolean variables $x_1,\ldots,x_n$ each of which is assigned a positive cost $c_1,\ldots,c_n\in\mathbb{Z}_{>0}$ and a boolean function $f$ on these variables given in the form
$$f(x_1,\ldots,x_n)=\bigwedge_{i=1}^k\bigoplus_{j=1}^{l_i}x_{r_{ij}}$$
($\oplus$ denoting XOR) with $k\in\mathbb{Z}_{>0}$, integers $1... |
I play 5-a-side soccer twice a week. 10 people play each game out of a pool of about 30 people who are giving the opportunity to play as it's first come first serve. Some people play more often than others.
The best matches are the ones where the score stays even throughout the game because they are the most competiti... |
I have a small number of documents (I could probably get 4 or 5 documents) and want to assign terms in these documents a score based on its importance to the document. I want to find which terms are simultaneously important to all of these documents.
These documents have different authors but are written about the sam... |
Exercise ask : Prove which a binary language L is recursive if and only if both L and {0, 1}* - L are recursively enumerable.
Now I try to give a solution:
Suppose that L is recursively enumerable.Then, would exist two machines M and M' such that simulate M and M' at alternate steps on two copies of the input x.
For al... |
What exactly is name hiding in c++? what are the advantages?
i already went through a couple of links but couldn't get a proper explanation for the same.
|
Given a distribution over graphs with $n$ nodes having the "scale-free" property, I would like to compute for a pair of vertices $(a,b)$ the probability that they are connected (or more precisely the probability that there is a directed edge from $a$ to $b$).
Is it possible to have such probability distribution ?
Note ... |
Suppose we have the following grammar:
S -> A ( S ) B | ε
A -> S | S B | x | ε
B -> S B | y
where S is the start symbol, S, A, B are non-terminal symbols, x, y, (, ) are terminal symbols, and ε is the empty string.
I'm trying to compute the FIRST() and FOLLOW() sets of S, A, and B.
FIRST(S) = FIRST(A ( S ) B) ∪ {ε}
F... |
I have a list of point-to-point $(x,y)$ positions representing a path. I would like to convert these points to a list of vectors consisting of straight segments $\{L\}$ and turn vectors $\{r, \theta\}$, where turns are represented by arcs on a circle. For example, the set of points
(0,0), (0,10), (5,15), (10,10), (10,0... |
I was solving one of my practice questions, defining a language with Context Free Grammar Productions , but I am stuck on one question , Here are my attempt:
Question: $L = \{a^n b^m c^p \mid n = m + p + 2\}$
My Attempt:
S -> aaBC
B -> aBb | ^
C -> ? (Now how can i increase length of `a` Terminal by C as i increas... |
So I have a problem, I'm highly confident that it's NP-Hard, though I'm not really sure how I can convince my self this is the case?
Suppose I have different groups of people m in a list
M= {m1, m2}
and a list of food they can eat and the respective cost in dollars
Food = {f1:2, f2:3, f3:2}
you have buffet and can choo... |
Let's suppose we are counting words in string. We split it so what we have is an array of strings. I'll use Python as an example.
The imperative approach would as follows:
wordcount = {}
for word in words:
wordcount[word] += 1
The functional would be:
uniquewords = set(words)
wordcount = [words.count(w) for w in ... |
I am writing my first paper, and one of the results can be written as follows:
For any $W,\epsilon$ such that $\epsilon = o\left(\frac{\log^4 W}{W\log\log W}\right)$ and $\epsilon=\omega\left(\frac{\log\log W}{W}\right)$, we obtain a $o(\min \{W, \frac{1}{\epsilon}{\log^2 W}\})$ space algorithm, improving the state of... |
I need help on this question:
Given a sorted array of distinct integers A[1, . . . , n], you want to find out whether there is an index i for which A[i] = i. Give a divide-and-conquer algorithm that runs in time O(log n).
How I can proceed?
Thanks a lot!
|
I need help on this exercise:
You are given an array of n elements, and you notice that some of the elements are duplicates; that is, they appear more than once in the array. Show how to remove all duplicates from the array in time O(n log n).
I find a solution but in O(n^2)... How can I apply D&C?
|
As Wikipedia says, quickSort needs O(log n) extra space when the following conditions are met:
In-place partitioning is used. This unstable partition requires O(1)
space.
After partitioning, the partition with the fewest elements is
(recursively) sorted first, requiring at most O(log n) space. Then
the other partition... |
Given a list of items which represent items in a shopping cart, and a list of available special offers which replace one or more regular items to lower the cost of those items, how can I decide the order to apply the special offers to minimize the final basket price?
For example, I have in my cart 4 items:
Coke \$2
Co... |
Brzozowski's algorithm can be extended to Moore automata but its time complexity is exponential in general. Is there any other algorithm for minimization of Moore automata? What are the running times of these algorithms if any?
|
How would I rewrite an XOR gate into the three basic logic gates (AND, OR, NOT). To be more specific, I have to write it in such a way with 2 NOT gates, 2 OR gates, and 1 AND gate. I also have to do it with 1 OR gate, 2 AND gates, and 1 NOT gate.
I'm not looking for just the answer, I'm looking for a way to come up wit... |
In a course on theoretical computer science we have to prove if sets are endless. I have two problems with the exercise:
I don't understand exactly, what an endless set is (I find it very hard to understand, maybe because of the "endless")
I don't know, how I can prove that the given sets are endless
The definition g... |
I want a constraint that:
if c=0 become x=0
if c > 0 become x=1
for example:
C < = M.X or
C> = M.X or
X=exp(-M*C)
that X is binary variable and M is huge value.
This constraint is very important for me.
Please help me.
|
My goal is to uniformly sample from a convex polytope. I know that for the simpler case, where I have to uniformly sample from a simplex, I can use Bayesian Bootstrap, discussed in these posts:
Uniform sampling from a simplex
Random vectors uniformely distributed into convex n-polytope
Therefore, I'm very interested in... |
The situation is as follows
'm' process shares 'n' resources of same type. The maximum need of
each process does not exceed 'n' and the sum all their maximum needs
is always less than m+n. In this set up will deadlock ever occur
This is a question from Operating System Concepts by Silberschatz, Gagne and Galvin.
... |
I have recently written code for detecting path colors in a 2D grid and printing the corresponding path costs and it works fine for me.
Here's my code; I am currently new to OpenCV and know only C++ (no python).
The image that I had for the project was:
Now I may get an image like this for the same task:
I need an al... |
I'm currently struggling to construct a nondeterministic PDA with an amount of states in $O(n)$ that accepts the following language:
$L = \{wcx \, | \, w,x \in \{a,b\}^n \land w \not= x\}$ with c being a delimiter.
In lectures we discussed DPDA that accept $wcw^R$ or NPDA that guess the middle of the word with an $\v... |
My question is about the control in the Turing Machine. As far as I know, the control of the Turing Machine is just a set of states. If the Machine needs to record something, it needs to write on the tape.
The following is an excerpt from Michael Sipser's Theory of Computation, the passage is about how a Turing Machin... |
Is there a name for a counted set (multiset) that is ordered?
For example lets say this data structure represents a shopping cart (or basket if you're British). The shopping cart shows the order the items were added to the cart unless an item of the same type was already added in which case a number associated with ite... |
It's well known that Hindley–Milner type inference (the simply-typed $\lambda$-calculus with polymorphism) has decidable type inference: you can reconstruct principle types for any programs without any annotations.
Adding Haskell-style typeclasses seem to preserve this decidability, but further additions makes inferenc... |
What are the non-trivial graph families that have a known chromatic number, or an easy way (polynomial-time algorithm) to compute the latter.
Examples would be:
Kneser graphs
Chordal graphs
Do you know any other families?
Motivation:
We are looking for interesting classes on which we can test a proper coloring heuris... |
I'm trying to sample uniformly on the intersections of faces of several simplicies, with all coordinates being non-negative. That is, given constraints
$$A\vec{w}=\vec{b} \ \ and \ \ \vec{w} \geq \vec{0} \ \ and \ \ \sum w_i = 1,$$
I want to sample $\vec{w}$ uniformly. $A$'s dimension is about $100 \times 10000$. A con... |
Let L be a language that fulfills the properties implies by the Pumping lemma for regular languages.
Does L necessarily fulfill the corresponding properties of the Pumping lemma for context-free languages as well?
|
While reading the following tutorial on iOS development Working with Foundation (section on Sets near the bottom), I came across the following statement: "Because sets don’t maintain order, they offer faster performance than arrays do when it comes to testing for membership."
The author doesn't mention the underlying d... |
How does the microprocessor convert the machine code to micro code?
What part of the processor is at play?
|
I am taking a course on Coursera about algorithm design. The course said that a time of $O(n \log n)$ is considered to be good.
However, there are faster runtimes such as (from now on just assume it is in big o notataion), such as $1$, $n$, and $\log n$. I understand that it is almost impossible to have a algorithm in... |
Given: A completely connected directed acyclic graph.
What would be the most efficient(Least Time complexity) way to find a shortest path among a very large number of nodes?
Constraint:
1)The result should be optimal.
2) The cost between any two connected nodes is computed in time complexity of O(layer-no). For, e.g., ... |
As I've already asked my Question about the solving Context Free Grammar
$L = \{a^n b^m c^p \mid n = m + p + 2\}$
Can this language be defined by a Context Free Grammar?
Now i have just changed n = m + p - 2 and still can't figure out,
Here is my attempt:
S -> Cc
B -> aBb | ^
C -> aCc | Bb
(In this Grammer i can't h... |
This is a question that has emerged from a recent quiz I have taken. In short
Consider the following transitions on a push down automaton. Assume the starting state is q. Which one of the following inputs will lead the automaton to state p with the stack containing the string XXZ?
I am gonna write only the transition... |
Given a set $Q\subset \mathbb{N}^m $ of $n$ points, we want to find the subset $S_{max}\subset Q$ of $k$ elements that maximize the total distance between them, according to the $\ell^1$ norm.
$$S_{max} = \arg \max_S\sum_{i,j \in S, i \ne j} d(x_i,x_j)$$
In my specific case, $Q\subset \{ 0, 1 \} ^m $, thus $d(\cdot,\c... |
I am trying to show that this is Turing Recognizable.
The language A, that is a DTM, T, that halts on a minimum of one input.
My justification is that of course it is because, you just need to check if an accept state is reachable. However, this seems like I am making it trivial.
Is there something larger I am missing?... |
Let A be a Turing Recognizable Language and B a finite Language.
I want to prove that their symmetric difference is Turing Recognizable.
My reasoning: B is finite, therefore the finite number of strings can be put through a DTM , M, such that L(M)= A. If M accepts, then remove that string from B and put it in a list, R... |
I'm programming a neural network. I know that I should initialize the network by picking random weights. How do I pick a random weight for the connections to bias nodes? What distribution should I use for these weights? I can pick a random value from the range $[0,U]$, but what value should I use for the upper limi... |
In an LR(0) parser, each state consists of a collection of LR(0) items, which are productions annotated with a position. In an LR(1) parser, each state consists of a collection of LR(1) items, which are productions annotated with a position and a lookahead character.
It's known that given a state in an LR(1) automaton,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.