instruction
stringlengths
0
29.8k
⌀
We know that $st\text{-}non\text{-}connectivity$ is in [$\mathsf{NL}$][1] by [Immerman–Szelepcsényi theorem][2] theorem and since $st\text{-}connectivity$ is $\mathsf{NL\text{-}hard}$ therefore $st\text{-}non\text{-}connectivity$ is many-one log-space reducible to $st\text{-}connectivity$. But is there a direct/combina...
|algorithms|graphs|
|automata|finite-automata|proof-techniques|induction|
|formal-languages|compilers|parsing|
null
Are log base 10 x and log base 2 x in the same big-O class of functions? In other words, can one say that log base 10 x = log base 2 x = O(log x)?
Are log_10x and log_2x in the same big-O class of functions?
|space-complexity|
Yes. Because they differ only by a constant factor. Remember high school math: $\log_2 x = \dfrac{\log_{10} x}{\log_{10}2}$.
Are $\log_{10}x$ and $\log_2x$ in the same big-O class of functions?
i want the conditional probability for each topic from the word that we give for example > have seen and reviewed your requirements you posted here. If you can > give me the fix criteria/category of your data mining then I can do > this job. If you want me to define and allot criteria and categorize > it in the...
Algorithum to find the probability of a given text or para from a large topic
|algorithms|logic|search-algorithms|
**breadth-first search (BFS):** is a strategy for searching in a graph when search is limited to essentially two operations: (a) visit and inspect a node of a graph; (b) gain access to visit the nodes that neighbor the currently visited node. The BFS begins at a root node and inspects all the neighboring nodes. Then fo...
Are $\log_{10}(x)$ and $\log_{2}(x)$ in the same big-O class of functions? In other words, can one say that $\log_{10}(x)=O(\log x)$ and $\log_{2}(x)=O(\log x)$?
Are $\log_{10}(x)$ and $\log_2(x)$ in the same big-O class of functions?
|landau-notation|
I want the conditional probability for each topic (being the word that we give as input). For example, the text being > have seen and reviewed your requirements you posted here. If you can > give me the fix criteria/category of your data mining then I can do > this job. If you want me to define and allot criteria...
Algorithm to find the probability of a given text to be about a large topic
|algorithms|natural-language-processing|
null
null
I'm currently doing some reading into AI and up to this point couldn't find a satisfying answer to this question: what's the difference between a rule based system and an artificial neural network? From my understanding both are trying to do inference based on a variety of different inputs.
What's the difference between a rule based system and an artificial neural network?
|artificial-intelligence|neural-networks|
I want to filter efficiently a list of integers for duplicates in a way that only the resulting set needs to be stored. One way this can be seen: - we have a range of integers $S = \{1, \dots{}, N\}$ with $N$ big (say $2^{40}$) - we have a function $f : S \to S$ with, supposedly, many collisions (the images ...
null
I'm in a programming course and one Problem given to us is to mark the order in which BFS visits nodes in a weighted graph. My question is whether BFS adds the distance of the previous path while adding a new vertex, as that will definitely change the order in which the vertices are added?
Does a weighted Breadth First search have "memory" when moving to the next vertex?
|graphs|
Dynamic programming with large number of subproblems. So I'm trying to solve this problem from Interview Street: > **Grid Walking** (Score 50 points) > You are situated in an $N$-dimensional grid at position $(x_1,x_2,\dots,x_N)$. The dimensions of the grid are $(D_1,D_2,\dots,D_N$). In one step, you can walk one...
How about transforming your original graph to a graph with dummy nodes and just use regular BFS on it? The idea is: if you have an edge with weight $k$ between $A$ and $B$, remove it. Then add a path between $A$ and $B$ with $k-1$ nodes in between, where all the edges have unit weight. Now you can use regular BF...
The weighted version of BFS is called [Dijkstra's algorithm][1]. You can check the pseudocode in Wikipedia. Alternatively, Dijkstra's algorithm is supposed to find the shortest paths from the origin to all other vertices. If you've seen a proof in class, you should be able to match the algorithm to the proof. Only one ...
The difference is vast, although as Dave wrote, the resulting black box might look the same from outside. Rule-based systems are examples of "old style" AI, which uses rules prepared by humans. Neural networks are examples of "new style" AI, whose mechanism is "learned" by the computer using sophisticated algorithms, a...
I want to find the order in which BFS visits nodes in a weighted graph. I also wonder whether BFS adds the distance of the previous path while adding a new vertex, as that will definitely change the order in which the vertices are added?
In which order does BFS visit the nodes in a weighted graph?
null
null
Prove or disprove the following statements: 1. $T\left( n \right) = 2T\left( {\frac{n}{2}} \right) + f\left( n \right),f\left( n \right) = \theta \left( {{n^2}} \right) $ then $ {\rm{ }}T\left( n \right) = \theta \left( {f\left( n \right)} \right) $ for all $ {\rm{ n = }}{{\rm{2}}^k}$ 2. $T\left( n \right) = 2T...
{"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
You can try simple probabilistic graphical models, the simplest one being [Naive Bayes][1]. [1]: http://en.wikipedia.org/wiki/Naive_Bayes_classifier
Just to give a slightly more general perspective than the other answers: "trying to do inference based on a variety of different inputs" is basically what much of the field is doing and it is a very general problem. The idea is that you are looking for some simple, general way to explain how data observations are as...
In [Knuth's original paper on $LR(k)$ grammars][1], he proved that the decision problem "Given a CFG $G$, is there a $k$ such that $G$ is an $LR(k)$ grammar?" is undecidable. Is there a similar result showing that it is undecidable whether a given CFG is an $LL(k)$ grammar for some choice of $k$? Or is this problem...
Determining whether a CFg is $LL(k)$ for any $k$?
The trouble is that you don't *know* $f$; it could be any one of the functions in $\Theta(n^2)$ resp. $\Omega(n^2)$. So let's unfold the classes! In case one, whichever function $f \in \Theta(n^2)$ happens to be the "real" one, we know that there is a $d_1 \in \mathbb{N}$ such that $\qquad \displaystyle f(n) \le...
The following shows that the second statement is false. Define $f$ as follows: $$ f(n) = \begin{cases} 4n^3 & n \text{ is a power of }4, \\ n^2 & \text{otherwise}. \end{cases} $$ Let $n = 2^{2k+1}$. Then $f(n) = n^2$ while $$ T(n) \geq 2T(n/2) \geq 2f(n/2) = n^3. $$
We know that st-non-connectivity is in [NL][1] by [Immerman–Szelepcsényi theorem][2] theorem and since st-non-connectivity is NL-hard therefore st-non-connectivity is many-one log-space reducible to st-non-connectivity. But is there a direct/combinatorial reduction that doesn't go through the configuration graph of the...
Direct reduction from st-non-connectivity to st-non-connectivity
We know that $st\text{-}non\text{-}connectivity$ is in [$\mathsf{NL}$][1] by [Immerman–Szelepcsényi theorem][2] theorem and since $st\text{-}connectivity$ is $\mathsf{NL\text{-}hard}$ therefore $st\text{-}non\text{-}connectivity$ is many-one log-space reducible to $st\text{-}connectivity$. But is there a direct/combina...
Direct reduction from $st\text{-}non\text{-}connectivity$ to $st\text{-}connectivity$
I'm in a programming course and one Problem given to us is to mark the order in which BFS visits nodes in a weighted graph. My question is whether BFS adds the distance of the previous path while adding a new vertex, as that will definitely change the order in which the vertices are added?
Does a weighted Breadth First search have "memory" when moving to the next vertex?
This grammar <stmt> ::= <label> <unlabeled stmt> <label> ::= ::= <name> ":" <name> ::= id <qual> <qual> ::= ::= "." id <qual> <unlabeled stmt> ::= <name> "=" <exp> is not $LL(k)$ for any $k$ (you need unbound look ahead to be able to decide if there is a label ...
null
By definition, $O(g)$ is a set and if you use this notation nested, you would have a set in a set, which would be wrong. ###The definition of the O-Notation### $O(g) = \left \lbrace f|\exists c > 0\exists x_0>0 \forall x > x_0: |f(x)| \leq c *|g(x)|\right \rbrace $ ###The mistake### You used terms like $ O(O(n)...
The trouble is that you don't *know* $f$; it could be any one of the functions in $\Theta(n^2)$ resp. $\Omega(n^2)$. So let's unfold the classes! In case one, whichever function $f \in \Theta(n^2)$ happens to be the "real" one, we know that there is a $d_1 \in \mathbb{N}$ such that $\qquad \displaystyle f(n) \le...
Im trying to prove that the language is nonregular. notprime = {a^n where n isnt prime} = {emptystring a aaaa aaaaaa aaaaaaaa} Heres what I have: "If notprime were regular, than its complement would be regular also. However, the complement of notprime is the language prime, hence notprime is nonregular " I...
Prove a language is nonregular
|automata|
Im trying to prove that the following language is not regular. $$\text{Notprime} = \{a^n \text{where \(n\) isn't prime}\} = \{\epsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots\}$$ Heres what I have: "If Notprime were regular, then its complement would be regular also. However, the complement of Notprime is the lang...
Prove that the language of non-prime numbers written in unary is not regular
|regular-languages|finite-automata|
I got no responses on stackoverflow, so I'm asking here: How useful is the LIS ([Longest Increasing Subsequence][1]) problem in tackling other CS problems? There are a few algorithms, using patience sorting, dynamic programming or with decision trees. How are these used in real life -- maybe to data streams or som...
Longest Increasing Subsequence
|data-structures|sorting|
This proof is correct, the complement of a regular language is indeed a regular language (and dually the complement of a non-regular language is non-regular). Your proof relies on the assumption that Prime is not regular. If this was given as an exercise and there wasn't an earlier question about Prime, then the intent...
null
null
Im curious if anyone knows if its possible to write a program to generate a regular expression given a finite automation. To make things less complicated I want to limit the number of states to about 4, assume the FA is in minimal form and that the FA has only one FinalState and only one StartState. Ive been t...
Generating a regular expression
|automata|finite-automata|regular-expressions|
Program that generates a regular expression from an FA
null
Here's one resource on the matter: www.cs.dartmouth.edu/~ac/Teach/CS39.../lec09dfa2regexp.pdf There's a commonly known Dynamic Programming algorithm which can do it. The link I send outlines the algorithm, though it doesn't convert to code. The DP algorithm is pretty common (I think it's usually used in the proof t...
|algorithms|
> **Possible Duplicate:** > [How to convert finite automata to regular expressions?](http://cs.stackexchange.com/questions/2016/how-to-convert-finite-automata-to-regular-expressions) <!-- End of automatically inserted text --> Im curious if anyone knows if its possible to write a program to generate a regular exp...
{"OriginalQuestionIds":[2016],"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
This looks like a fundamental result but I can't find a resource online that gives an intuitive interpretation of this complexity. Any basic explanation is appreciated.
Why does it take O(n^2) to simulate a 3-tape TM on a single tape TM?
|turing-machines|
Below is the lambda expression which I am finding difficult to reduce i.e. I am not able to understand how to go about this problem. (λmn(λsz.ms(nsz)))(λsz.sz)(λsz.sz) I am lost with this. if anyone could lead me in the right direction that would be much appreciated
Lambda Calculus simplification
|logic|lambda-calculus|
Lambda terms are simplified by the [β-reduction rule](https://en.wikipedia.org/wiki/Lambda_calculus#Reduction): $$(\lambda x.M)N\,\rightarrow_\beta\,M[x:=N]$$ It means, if you have a subterm that looks like $(\lambda x.M)N$ (called _redex_) you can replace it by $M[x:=N]$, which is $M$ with $N$ substituted for $x$....
Below is the lambda expression which I am finding difficult to reduce i.e. I am not able to understand how to go about this problem. $$(\lambda mn.(\lambda sz.ms(nsz)))(\lambda sz.sz)(\lambda sz.sz)$$ I am lost with this. if anyone could lead me in the right direction that would be much appreciated
null
null
There are two Context Sensitive Languages, L1 and L2. Which of the following are decidable or undecidable about them (a) L1 is empty. (b) L1 generates all possible string over given set. (c) L1 intersection L2 is null set. (d) complement of L1 is also a context sensitive language. (e) L1 is e...
What operations unders context sensitive languages are decidable?
|undecidability|
I want to filter efficiently a list of integers for duplicates in a way that only the resulting set needs to be stored. One way this can be seen: - we have a range of integers $S = \{1, \dots{}, N\}$ with $N$ big (say $2^{40}$) - we have a function $f : S \to S$ with, supposedly, many collisions (the images ...
How about transforming your original graph to a graph with dummy nodes and just use regular BFS on it? The idea is: if you have an edge with weight $k$ between $A$ and $B$, remove it. Then add a path between $A$ and $B$ with $k-1$ nodes in between, where all the edges have unit weight. Now you can use regular BF...
This is a similar algorithm to one I used in a previous question, but I'm trying to illustrate a different problem here. for (int i = 0; i < numbers.length - 1; i++) { for (int j = i + 1; j < numbers.length; j++) { if (numbers[i] + numbers[j] == 10) { System.out.println(i+"...
How to go about working the average case run time of this trivial algorithm (and other algorithms)?
|algorithms|runtime-analysis|
> **Substring Diff** (35 Points) > Given two strings of length $n$, $P = p_1\dots p_n$ and $Q = q_1 \dots q_n$, we define $M(i, j, L)$ as the number of > mismatches between $p_i \dots p_i+L-1$ and $q_j \dots q_j+L-1$. In set > notation, $M(i, j, L)$ refers to the size of the set {$0 \leq x < L$ | $p_(i + x) \neq q_...
What property is needed to reduce subproblem space in this string problem?