instruction stringlengths 35 29.1k |
|---|
In a programming contest I've encountered a problem which is for sure a linear programming problem. I know quite a lot about LP (the simplex method, its exponential complexity, interior point methods, their polynomial complexity, etc.), yet I stumbled upon it. What is the simpliest algorithm for linear programming by m... |
What is the cardinality of the following set
$M: = { \text{M is a Turing Machine with} \sum_{i}=\text{{0,1} and LA(M)=L}}$
where $ \text{L is a recursively enumerable language such that } L \subseteq \text{{0,1}}*$
Which means how many TMs semidecide a recursively enumerable language L?
We know that the set of all r.e... |
When reading about shortest paths in Cormen . I came across this paragraph which says that 'shortest path cannot contain' positive edge path even. But I don't understand the logic behind their explanation
Can a shortest path contain a cycle? As we have just seen, it cannot contain a
negative-weight cycle. Nor can it... |
I am working on a problem which could be reduced to a graph optimization problem as below.
A set of colored nodes is given.
The edges are to be inserted between the nodes.
A node can have only 4 edges at max.
A table provides rules for profit contribution from the edges.
Eg.,
An edge connecting red to red: profit is ... |
As far as i can understand the problem of checking safety property, can be reduce to solving for inductive invariants in VC's and there is following parts to it:
Generate VC's from the program.
Solve it: If user provide inductive invariants just check the Validity of the whole VC formula.
Inferring problem : simultan... |
I'm trying to solve an exercise on inductive definitions, the premiss is:
Let $\to$ be a relation on $A$ and $\to^*$ its reflexive, transitive closure, which is defined by following two rules:
$a \to^*a$ (reflexive)
${a \to^*b \quad b \to c \over a \to^*c }$ (step)
The questions are:
What are the induction rules f... |
Let $x,y,n$ be $1234567809, 12345, 9087654321$. My laptop can perform 1 64-bit mod operation in 1 microsecond. Estimate the number of seconds needed for each of the following:
Find $x^y \pmod{n}$
Find $t$ such that $x^t \equiv 2672633475 \pmod{n}$.
I guess around 10^45 digits, am I right and how do I calculate time... |
Let G(V,E) be a graph and H(V',E') be some induced subgraph of G. Let v be a vertex from V'. Is there an efficient way to calculate the degree of v in the subgraph H if we have some representation of G? (Preferably it should be O(1))
|
This grammar is left recursive:
Expression ::= AdditionExpression
AdditionExpression ::=
MultiplicationExpression
| AdditionExpression '+' MultiplicationExpression
| AdditionExpression '-' MultiplicationExpression
MultiplicationExpression ::=
Term
| MultiplicationExpression '*' Te... |
Suppose we have two human bodies. We need to find some number that represents a similarity score between the two bodies.
However in order to achieve that we need to find the similarity between the corresponding body parts.
Suppose we already have a function that returns a similarity score for body parts.
Example:
doubl... |
If $a$ and $b$ are different elegant programs (minimal program for some output), is their joint Kolmogorov complexity the sum of their individual complexities, i.e. $K(a,b) = K(a) + K(b)$?
|
I'm working on finding an Euler circuit for an indoor geographical 2D grid. when abstracting the grid as a an undirected graph, all nodes in the graph are connected (i.e, there is a path between every node in the graph). The graph could be huge (more than 100,000) nodes. The requirements are simple :
1- The generated p... |
I am attempting to work through an example of how to select an error bound, and then determine the number of simulations necessary by the amplification lemma to obtain the desired error bound. I have probabilistic Turing machine $M$ with an error probability of $.5$. I'd like an error bound of $.25$, so I will bound th... |
As an exercise we were supposed to find a grammar $G$ that generates language $L(G) = \{w \in \{a,b\}^* \mid |w|_a = |w|_b\}$.
That was not so hard, I found a grammar which I think is correct:
$S \longrightarrow bA \mid aB$
$A \longrightarrow a \mid aS \mid bAA$
$B \longrightarrow b \mid bS \mid aBB$
Though then I fou... |
Since $K(a|a) = 0$, is $K(b|a) \geq 1$ when $a\neq b$, as we need at least one bit to distinguish between $K(a|a)$ and $K(b|a)$? If not true in general, is it true if $a$ and $b$ are elegant programs?
|
I was just thinking about the powerset construction and it is clear to me that the powerset construction will result into a DFA $D$ with possibly redundant states, as the NFA $N$ is not minimized. But in case where $N$ is minimal will $D$ will also be minimal?
So is there a DFA $D'$ with less states for the same Langua... |
I want to understand how a turing machine that will accept only words of length bigger than 100 will look like.
My idea: it will copy a word and move to the right 100 times.
If non of the cells was empty it will accept.
Furthermore if it is true I can also conclude that it is decidable .
If there is no problem with ... |
Here is a link to the isolation lemma. Please refer to the statement and Spencer's proof at the given link.
https://en.wikipedia.org/wiki/Isolation_lemma
In its statement, shouldn't there be a condition $N>=n$ since the probability is defined as $1-n/N$? Also, is it not required that the intersection of all sets in a ... |
On a standard computing model that reflects reality for sequential processing, such as a RAM machine with penalized access time for growing memory, can a comparison sort algorithm work in both logspace yet sub-quadratic time?
Standard algorithms for sorting are O(n*log(n)) time yet I've found that once these programs a... |
I'm looking at Push–Relabel Maximum Flow Algorithm (or Goldberg-Tarjan Algorithm) and trying to solve some homework question.
As part of the answer I'm trying to prove $x_{f}(s)\leq0$
during the entire algorithm run (where $s$
is the source, and $x_{f}:V\to\mathbb{R}$
is the excess function $x_{f}\left(u\right)=\... |
(I expect that the hard part of this question is getting the right language for the problem. My attempts at searching for an answer didn't get anything useful, which suggests to me that whatever they are, I'm not using them!)
Consider a map where each x,y coordinate has an associated "height" value. If we have two po... |
Suppose that we take a neural network of a given topology, and run it through two training processes, obtaining two different sets of converged weights at the end of the training.
What is a good way to measure the difference between the two sets of weights?
If this were a curve-fit where the parameters were largely ort... |
Given n pancakes, for each permutation we can compute the minimum number of pancake flips. If we take the maximum over all possible permutations, we get the worst case pancake number $P_n$.
I think I can prove that $P_n \geq n$. My argument is that I can start from the sorted pancake, and do a "anti-sorting" of the p... |
Algorithm complexity is designed to be independent of lower level details but it is based on an imperative model, e.g. array access and modifying a node in a tree take O(1) time. This is not the case in pure functional languages. The Haskell list takes linear time for access. Modifying a node in a tree involves making ... |
I am an undergraduate studying Data Coms and Networking and this question about go-back-N ARQ popped up that I am struggling to get my head around and cant find anything similar online. Any help at all would be greatly appreciated.
The only thing I have at all is that throughput could be defined by (Packet bits + overh... |
I was reading about Dijkstra algorithm and was referring two books
1) Introduction to Algorithms by Cormen Section 24.3
2) Algorithm design by Kleignberg Section 4.4
And found a subtle difference in their way of show Dijkstra algorithm
book 1:
Dijkstra(G, w, s)
Initialize(G,s) d(s) = 0 initialize others to inf
S = {}
Q... |
I am reading the NP-hardness proof of Super Mario Bros. in the paper "Classic Nintendo Games are (Computationally) Hard" by Greg Aloupis, Erik D. Demaine, Alan Guo, and Giovanni Viglietta.
I can get the basic idea of the proof framework presented in Section 2.1. I think I also understand the Start gadget, Finish gadge... |
Theorem : To prove $ \mathsf{\text{} Regular} \subseteq \mathsf{\text{}NC^1}$.
To prove the theorem stated above we need some theorems and definitions given below :
Barrington Theorem : A branching program of constant width and polynomial size can be easily converted (via divide-and-conquer) to a circuit in $\mathsf{\... |
The question whether there exist languages in $\mathsf{E}$ that require circuits of size $\Omega(2^{\delta n})$ for some $\delta > 0$ is open, and this would imply some derandomization results.
Suppose we have a language $L$ which is complete for $\mathsf{E}$. Then, how can $L$ have sub-exponential size circuits? If $... |
I'm introducing to the Natural Language Processing field and it's application. I'm planning to build a question answering system for a project, but some approaches are making me a bit confuse about the use of ontologies and it's application on the architecture of the system. I understand that an Ontology in definition ... |
It is possible to find the total number of inversions by $\mathcal{O}(n\log{}n)$ running time (extension of merge-sort algorithm for example).
Is there more asymptotically efficient way to do it? $\mathcal{O}(n)$?
Or is there any proof that’s not possible?
|
Here is my Halting Problem proof, that largely mirrors other (non-diagonalizing) proofs that I've seen.
$H(p,i)$ returns $1$ if program $p$ halts on input $i$.
$H(p,i)$ returns $0$ if program $p$ does not halt on input $i$.
Let $f(t,t)$ be an interface for any program that returns a $0$ or a $1$.
$g(x)$ is $0$ if $f(x... |
I know that similar questions have been asked before but I still wasn't able to find answers to all my questions.
In many proofs in complexity theory we use an enumeration of some $T(n)$-time Turing machines. For simplicity, let's consider polynomial-time TM's. I want to know exactly how we construct such an enumeratio... |
We are given a $n \times n$ grid, where each node can maintain a single "active" edge with one of its 4 neighbors at each time step. The active edge of each node changes periodically clockwise or anticlockwise, in the sense that if, for example, at time $t$ node $v$ has an active edge with its upper neighbor, and it ro... |
From what I can see it seems like RNNs favour using a backprop through time method which I haven't seen really applied to other neural networks.
Can someone explain the significance of tying the weights and why it is necessary to be done for backprop through time?
|
Is it possible to simulate a stack-based machine using a 1-tape turing machine? I cannot wrap my head around it as turing machines do not provide mechanisms such as pointers.
I failed to find any examples or explanations. If it is possible, how?
|
Given a sorted array of $n$ integers ,and some other integer $m$, find the $3$ numbers in the array $x,y,z$ such that $x+y+z\ge m$,and their sum is minimal.
If there are no such,return null.
Any ideas for an efficient algorithm to find it?
|
Why each function may be computed with circuit with 2^n gates ?
I am trying to understand this thing, but I can't. In particular why function constant $1$ requires $2^n$ gates. For me, it should be simple to return $1$ regardless of input.
|
For a prime power $q$, consider polynomials $f_1,f_2 \in \mathbb{F}_q[x]$. Then, do we have an efficient way of checking whether there exists an algebra isomorphism between:
$$\frac{\mathbb{F}_q[x]}{\langle f_1 \rangle} \text{and} \frac{\mathbb{F}_q[x]}{\langle f_2 \rangle},$$
and computing one such isomorphism if it ... |
Ever example of computation on a probabilistic Turing machine that I have read uses only a binary tree to show the computational branches of a probabilistic Turing machine. I know that an NTM may use as many branches as needed during a computation, so is this also the case for a PTM? Or is a PTM limited to only binary ... |
Given a Turing Machine M with n states, alphabet A, m variables, a set S indicating the possible values that each variable can take, and an input x, is there a minimum number of steps that M has to take? I'm wondering if it is possible to construct a Turing Machine that takes only one step regardless of any of the afor... |
So this is my first time posting, but I don't know where else to go. I've spoken with several PHD and Masters students and they referred me here. I've been looking at the Vertex Cover problem and came up with an algorithm to find the optimal minimum. I've tried this on several graphs as examples and it's found the opti... |
I am having trouble finding the solution to this interview-like question:
$T(n)$ is given as:
$$T(n) = \begin{cases} 1 & n \leq c, \\ 2T(f(n))+1 & n > c, \end{cases}$$
where $c$ is some constant.
Find a function $f(n)$ so that $T(n) = \Theta(\log\log\log\log n)$.
|
I am totaly new to theoretical computer science, so I am sorry if I get the terminology wrong:
I was reading the definition of a grammar, what I didn't get was the formal definition of the production rules:
Let V be the set of Variables and sigma the alphabet. Let P be the set of Rules or productions. Formal: $P \subse... |
I have to train a SVM for a classification problem. I have some strings that are the paths in a deterministic finite automata (DFA). If the alphabet is -01- then possible strings are 011101110 or 0110 for example. The purpose of classifier (SVM) is the correct prediction (label) of unseen strings like accepting or r... |
I'm trying to understand a paper (Tandem Networks of Universal Cells, Butler, 1978 1), but I can't make it past the first paragraph:
Consider the $x_l … x_{k - 1} | x_k$ partition matrix of a function $f(
x_1, x_2, …, x_k)$, as shown in Fig. 1, where $C_0$ and $C_1$
represent the $x_k = 0$ and $x_k = 1$ columns, res... |
A question from chapter 3 of Michael Nielsen's [Neural Networks and Deep Learning]:
It's tempting to use gradient descent to try to learn good values for hyper-parameters such as the regularization parameter $\lambda$ and the learning rate $\eta$. Can you think of an obstacle to using gradient descent to determine val... |
I'm coding a program to calculate the value of $e^x$ by using the Taylor expansion, that is:
$$ e^x =\sum_{k=0}^\infty \frac{x^k}{k!} $$
from math import factorial
def e_x(x, n):
return sum(pow(x, k)/factorial(k) for k in range(n))
Edit: Python seems to handle large integers pretty well so I'm more interested in t... |
I've read in multiple articles and books that the computation of a cycle cover
for a given graph is possible in polynomial time, since this problem can be
viewed as the assignment problem, which is a special type of matching problem.
It's written in the Algorithmic Aspects of Bioinformatics (Spring-2007) and in the Min... |
I'm taking a fairly challenging Algorithm course, in which we are learning about algorithms such as Dijkstra, Bellman-Ford etc. as well as the algorithm design patterns such as recursions, DP and various graph construction techniques such as layering. Now I really have some trouble to design correct and efficient algor... |
This is Exercise 2.11 of the book "Computational Complexity: A Modern Approach" by Arora and Barak.
Mathematics can be axiomatized using for example the Zermelo-Frankel system, which has a finite description. Argue at a high level that the following language is $\text{NP}$-complete. (You don't need to know anything ab... |
According to the polynomial-time-reduction definition
"If problem $Y$ can be reduced to problem $X$ in polynomial time, we denote this by $Y \leq_p X$."
If $X$ is one of already known NP-complete problem then we can say that $Y$ is NP-complete.
From my understanding, $p$ should be always polynomial and this cannot be a... |
Using dyadic intervals, I can build a binary tree for $\left[0,+\infty\right)$ by having a node the $i$-th at level $l$ representing the range
$\left[i\cdot2^l,(i+1)\cdot2^l\right)$ and has the $(i)$- and $(i+1)$ at level $l-1$ as children.
I would like to build a similar tree for $(-\infty,+\infty)$, but it is not cle... |
I'm having some problems in understanding the two alternative definitions of NP. They're presented as equivalent, but to me they seem to define different class of problems. Intuitively, we can think of a non-deterministic TM as branching at every step to check all possible alternatives in parallel. Also, we can see it ... |
There are many examples of trade-offs in computer science. The space-time trade-off is a well-known one. Often an increase in memory use can lead to faster execution time, and vice-versa. Caching results that are computed or fetched from some storage increases memory use but avoids repeating the same time-consuming tas... |
Suppose we want to use a reduction of 3-colorability to a certain problem to prove said problem is NP-c. But to pull off the reduction, one needs to take a graph-class for which 3-coloring is NP-c and for a given input graph decompose its edges into as few independent groups as possible - basically edge-coloring the gr... |
For a regular language $L$, is $\{xy^Rz:xyz\in L\}$ regular?
[Where $w^R$ is the reverse of $w$]
My intuition says it is, as for a regular $L$, the languages $L^*$, $\{y: xyz\in L\}$ and $L^R$ are all regular languages, but I wasn't able to build a DFA/NFA for it, as if I try and "guess" from where to reverse the wor... |
An independence system is a collection $I$ of subsets of $\Omega$ such that if $A\in I$, then any subset of $A$ is in $I$. These sets are called independent.
Suppose I have an oracle for testing independence. In particular I have an ambient set $\Omega$ and an independence system $I$ of subsets of $\Omega$. I pass a su... |
Suppose I have a task to write an algorithm that runs through an array of strings and checks if each value in the array contains s character. The algorithm will have two nested loops, here is the pseudo code:
for (let i=0; i < a.length; i++)
for (let j=0; j < a[i].length; j++)
if (a[i][j] === 'c')
do s... |
REGULARTM is defined as below:
REGULARTM ={〈M〉| M is a TM and L(M)is a regular language}.
I am trying to understand the proof of REGULARTM being undecidable from Sipser's book "Introduction to the Theory of Computation". The book says:
We let R to be a TM that decides REGULARTM and construct TM S to decide ATM. Then S... |
I'm trying to implement an SMA* graph search algorithm that I found in a paper here(Rong Zhou, Eric A. Hansen: Memory-Bounded A* Graph Search. FLAIRS-02 Proceedings 203-209) and I would like to clarify my understanding of the pseudo-code found in the appendices, specifically the set builder notation used:
What I under... |
I have a graph which looks something like below
I am searching for a given string s going down such that at every node it makes a decision (either to visit the left node or right). The code goes something like this.
String s=input;
Node CurrentNode=start;
int rightSubstringIndex=-1;
int leftSubstringIndex=-1;
while(... |
I'm wondering if there are any useful functions asymptotically greater than a polylogarithmic function and less than a polynomial function.
That is, a function $f(n)$ such that
$f(n) = \omega(\log(n)^k)$ for some constant $k > 0$
and
$f(n) = o(n^k)$ for some constant $k > 0$
What I mean by useful, is that it was used ... |
Is it possible for an ordinary Turing Machine, for some input x, to run for an infinite number of steps but also halt? Or do we say that Turing Machine does not halt on x?
|
It's already known that size doesn't matter always (for SAT problems).
But is there evidence (from real data from: benchmarks or real cases) on how many clauses an average SAT solver can handle nowadays?
Another issue that derives is that once they find a solution, most don't stress the fact about finding alternative ... |
From Sipser,
Language A is mapping reducible to language B, written $A \leq_m B$,
if there is a computable function $f : \Sigma^* \rightarrow \Sigma^*$, where for every $w$, $w ∈ A \Leftrightarrow f(w) \in B$. The function $f$ is called the reduction from A to B.
A function is injective if every element in the co-domai... |
Consider a partially observable Markov decision process (POMDP), see here for a complete definition.
My question is in relation to the conditional observation probabilities (denoted by $O(o|s',a)$ in the above link). This represents the probability of seeing observation $o$ if the current state is $s'$ and the action w... |
Suppose we have $n$ lines $L_1, L_2, \dots, L_n$, where $L_i$ has the equation $y = a_i x + b_i$. We call $L_i$ the highest line at $x_0$ if for each $j \in \{1, 2, \dots, n\}$
$$a_i x_0 + b_i \ge a_j x_0 + b_j.$$
Goal: Find an algorithm in $O(n \log n)$ time to return a set of lines that are the highest lines in at l... |
I have a data set that uses a very simple modulo 10 checksum algorithm which ignores alphabetic characters entirely. Which wasn't a big deal, as the few alphabetic characters present weren't critical.
Changes to the data format are upcoming, including characters which will now be critical to the interpretation of the... |
In a an exercise I'm required to analyze the runtime of recursive function:
foo(n)
for i from 1 to n
work() // O(1)
foo(n-1)
end for
end foo
The recurrence relation I understand from the code is: T(n) = n*T(n-1) + n
But I'm failing trying to analyze it using the iterative method since I d... |
The Calculus of Constructions is a very simple core functional language with dependent types. Per curry-howard isomorphism, it could, potentially, be very useful for writing programs and proofs. It, though, has a few problems: induction isn't derivable, it isn't possible to prove 0 != 1, and pattern matching on algebra... |
Suppose that $G = (V,E)$ is a directed graph such that each vertex in $V$ is in at least one edge in $E$. We'd like to decide whether or not $w$ watchmen can be placed on $w$ distinct vertices in $G$ such that every vertex in $G$ is being "watched" by some watchman. More formally, we'd like to decide whether there exis... |
I was looking https://stackoverflow.com/questions/16369714/transform-a-simple-directed-graph-to-a-simple-undirected-graph , but i couldnt really understand the thought process behind this. Please help me.
|
I have following grammar:
$$A \to a A a \mid \varepsilon$$
This grammar is not ambiguous because it has no more than one parse tree from the any sentence generated by this grammar, but there is a shift-reduce conflict in LR(1) on this grammar.
Why does there exist an conflict even though it is not ambiguous grammar?
|
I understand that Halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running or continue to run forever. That is, there are two options for HP: Halt (accept/reject) OR loop.
With this definition of HP, I am unable to understa... |
I am currently working on image classification methods. One group of preprocessing methods are color space transformations. While there are "traditional" color spaces like RGB (the raw data), HSV, LUV, XYZ, ..., I see any function
$$f:[0, ..., 255]^3 \rightarrow [0, ..., 255]^3$$
as a transformation from one color spac... |
i am trying to solve a graph based problem , this is the statement:
i have to find shortest route from position marked (s) to position marked (S) [Note : i marked S and E just for ease of understanding]. here is the catch in problem i can go only through cells marked 0 and cells marked 1 represents walls which are impa... |
Is the following problem NP-hard:
Input: $A\subset\mathbb Z, k\in\mathbb N$
Question: is there a multiset of indices $I$, such that $|I|=k$ and $\sum_{i\in I} a_i=0$?
For example, on the input $A=\{-1,2\}, k=3$ we can take $I=\{1,1,2\}$ and thus we get $|I|=3$ and $a_1+a_1+a_2=(-1)+(-1)+2=0$, as desired.
|
I'm studying the SIFT algorithm and I have some problem understanding its operation, in particular I don't understand how the results vary according to the parameters: number of octaves, number of levels and sigma0.
I've read Lowe's original paper and I've done searches online but I still have doubts, I hope you can so... |
This is a special case of the question:
Counting permutations whose elements are not exactly their index ± M
The $M=0$ case has already been solved, but no one was sure how to work out the non-zero cases.
So I decided to try to just brute force some values and search the results for a recursion relation. As a test I ... |
(Shortest Common Superstring:
Input: A set S = {s1, . . . , sn} of strings over an alphabet Σ.
Feasible solutions: Each superstring w of S, i.e., each string w that contains all strings $s_i$ ∈ S as substrings. )
I just finished implementing cycle cover superstring algorithm, but step 4 and 5 just doesn't make sense to... |
Knowing that NFA-minimization has been proven to be P-SPACE complete, what if there is a polynomial-time algorithm to minimize NFA? Does that imply that P = PSPACE?
|
I was just looking into properties of languages and wondered about the cardinality of them
are all recursive languages countable or can they also be uncountable
(can u have a recursive language which is uncountable?)
can r.e languages be countable and uncountable?
(can u have a r.e but not recursive language which is ... |
I've been struggling to understand why the interactive proof for #SAT stops after only $m$ rounds, where $m$ is the number of variables in the formula $\phi$. I understand that two polynomials of degree $d$ can agree for at most $d$ values. As the proof in the Sipser text goes (which I believe is the standard proof), t... |
I need to design a turing machine that accepts $L=\{ww^Rw\mid w\in\{0,1\}^*\}$.
$w^R$ is the reverse of $w$.
I don't have a good idea yet how to do that, I know I should check:
the length of the word must be equal $0\mod 3$
$ww^R$ is a palindrome
the prefix $w$ equal to the suffix $w$.
I thought maybe to divide ... |
So I've got this so far to try and wrap my head around the abstract idea of a semaphore:
A semaphore is a variable or abstract datatype (commonly an integer),
used to control access to a common resource by multiple processes in a
concurrent system.
I'm not sure that this definition fully encompasses the full idea... |
I am new to theory of computer science and I am currently reading about CTF grammars. In our lecture we defined that a Type 1 grammar is context-free if for $w_1 \to w_2$, $\vert w_1 \vert \leq \vert w_2 \vert$.
I looked on the internet for an example and found this context-free grammar for palindromes: $G = \{\{P\},\{... |
I'm implementing a Column Generation algorithm. The pricing problem, in general, find more than one column with negative reduced costs(the master is a min problem). If i add only the most negative reduced cost column per iteration, at the end i have a linear relaxation with $Z = 8240.3$. When i tried adding all the col... |
In a question I had asked earlier, I was interested in knowing whether we could decide in polynomial time whether, for a directed graph $G$ with every one of its vertices belonging to an edge, a size-$w$ watch set, with $w$ at least half the number of vertices in $G$, exists (see the linked question). Several users sho... |
I have one query, Operating system (In machine language) as I study is the combination of opcodes that executes, Now, the opcodes are dependent on the instruction set architecture like how and which opcodes are executes. There are number of architectures such as RISC, CISC, Intel x86 which by sure have different opcode... |
If there is a transition with no input in the FA, when it is converted to a regular expression should it be accepted as ɛ transition? As an example picture shown below, should regular expression showing possible transitions between 1 and 3 (1-2-3 , 1-3) be accepted (ab+ɛ) or just ab?
|
Why does (if so) the seperator $\#$ is making a difference between the two languages ?
Let say:
$L=\{ws : |w|=|s|\, w,s\in \{0,1\}^{*}, w \neq s \}$
$L_{\#}=\{w\#s : |w|=|s|\, w,s\in \{0,1\}^{*}, w \neq s \}$
Here is a proof and a grammer representing $L$ as a $CFL$
And below Im adding a proof for $L_{\#} \notin CFL$ ... |
Question : Are my Justifications Correct?
Pumping Lemma
$A = \{0^n1^n \mid n \geq 0\}$. Prove $A$ is not regular :
Suppose $S = 0^p1^p$ and $p = 3$.
Therefore, $S = 000111$. Breaking $S$ into $xyz$
Case 1 :
$y$ is in the $0's$ part.
Therefore, $xy^iz \notin A $ for $i = 3$, because if $i = 3$, then
$S_i = 0 000 111$ T... |
Carter and Wegman introduced in the paper Universal Classes of Hash Functions the $H_{1}$ universal class of hash function. This is essentially the function
$h_{a,b}(x) = ((a\cdot x+b)\mod p)\mod m$. I am using here the more common notation from CLRS book respective description, and not from the paper.
Some notation:
... |
It seems that non-deterministic Nick's Class (NNC) would be the same as non-deterministic polynomial time, but I haven't been able to find anything on NNC.
|
let's consider that we already have constructed heap array.
so from this, when we do heap sort, the number of elements that have to be sorted decreased. I mean heap decrease.(which also means heap tree level decreases -> downheap operation level decreases
but nlogn means each n nodes has logn operation. But not all nod... |
There are two commonly mentioned partition methods:
algorithm lomuto_partition(A, lo, hi) is
pivot := A[hi]
i := lo - 1
for j := lo to hi - 1 do
if A[j] ≤ pivot then
i := i + 1
swap A[i] with A[j]
swap A[i+1] with A[hi]
return i + 1
algorithm hoare_partition(A, lo, hi) is
pivot := A[lo]
i := lo... |
I read a commonly known proof of transitivity of logspace reduction:
Lemma 6.: http://www.cs.au.dk/~arnsfelt/CT10/scribenotes/lecture5.pdf
. In this proof it is used following trick: Let some turing machine $M_f$ for language $f$ compute only $j$-th bit of output. Ok, $M_f$ is logspace machine, however tape with outp... |
Many (tensorflow) implementations of batch normalization seem to use moving statistics at its inference phase (R2RT, tf.contrib.layers.batch_norm).
But in the algorithm from the original paper, they use population statistics in the batch normalization function.
The thing is, pardon me, I don't understand why most of... |
The PDA has to recognize the language $L = \{w\in \{a,b,c\}^* \mid |w|_a = |w|_b$ or $ |w|_a=|w|_b\}$.
Currently I have an automaton which recognises that language if $|w_a|=|w|_b$ xor $|w_a|=|w|_c$. It looks like this:
It is xor because it is going to empty the stack before it could check next letter's occurence. My... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.