instruction stringlengths 0 29.8k ⌀ |
|---|
tldr: There is no silver bullet language.
I hope they won't sue me, but here is a pic from one of the Stanford presentations.
![enter image description here][1]
When you decide to pick a language, you can pick **only 2 of these 3 features**.
And that is why people are sad and want to invent a superlanguage... |
null |
When an SQL statement is turned into an execution plan, several optimization techniques are used. The use of indices allow to efficiently (without a full scan) select tuples that agree with a selection condition. Another technique in use is semantic optimization, *id est*, to turn a query into an equivalent one with be... |
When an SQL statement is turned into an execution plan, several optimization techniques are used. The use of indices allow to efficiently (without a full scan) select tuples that agree with a selection condition. Another technique in use is semantic optimization, *id est*, to turn a query into an equivalent one with be... |
I try to solve the following computational geometry problem.
>Let S be a set if $n$ axis-parallel rectangles in the plane, so that the bottom edge of each rectangle in $S$ lies on the $x$-axis.
>1. What is (an upper bound on) the combinatorial complexity of the union K of the rectangles in S?
>2. Give an effici... |
There is no algorithm that given a context-free grammar, decide if a DPDA recognizes the same language and computes it if it exists.
Because if such an algorithm existed, we would be able to decide the [undecidable problem of the universality of a context-free grammar][1] i.e. whether a given context-free grammar $G... |
The following proof only uses basic modular arithmetic, and the fact that the least common multiple $\mathrm{lcm}(a,b)$ is equal to $a\cdot b$, if $\gcd(a,b)=1$.
Injectivity:
-
Assume there are two different $a,b\in \{0,...,m-1\}$, $a>b$, such that $f(a)=f(b)$. This means that
$$
a\cdot w \mod m = b\cdot w \... |
can someone help me with the following exercise?
In the formation of a regular expression from a finite automaton $A$ with three states they have been calculated the following parts, in which 1,2 and 3 been renamed, 1 is the start state and 2,3 are accepting states:
$L^2 _{1,1} = b^*(aab^*)^*$
$L^2 _{1,2} = b^*a... |
regular expression |
|formal-languages| |
I need help with the following exercise:
Construct an $\varepsilon$-NFA for the following regular expression $(a|\varepsilon)(ba)^*(c^*a|bc)^*$.
i already tried this exercise with nerode but i didnt come to a solution please help me
thank you guys
Source wiki
Nerode : (Given a language L, and a pair of s... |
construct regular expression |
|formal-languages| |
1. $L_a = \{ a^*cw \mid w \in \{a,b \}^* \land |w|_a = |w|_b \}$
>! $L_a \cup d^* = L_a'$
$L_a' = \{ \{a,d\}^*cw \mid w \in \{a,b,d \}^* \land |w|_a + |w|_d = |w|_b \}$ (union?)
>! $L_a' \cap a^*cw = L_a''$
$L_a'' = \{ d^*cw \mid w \in \{a,b \}^* \land |w|_a = |w|_b \}$
>! homomorphism $ h... |
> **Possible Duplicate:**
> [Construction of a regular expression](http://cs.stackexchange.com/questions/2008/construction-of-a-regular-expression)
<!-- End of automatically inserted text -->
can someone help me with the following exercise?
In the formation of a regular expression from a finite automaton $A$ wit... |
{"OriginalQuestionIds":[2008],"Voters":[{"Id":31,"DisplayName":"Dave Clarke"},{"Id":98,"DisplayName":"Raphael"}]} |
Machine Learning algorithms based on "structural risk minimization"? |
null |
|formal-languages|finite-automata|regular-expressions| |
The model for $\text{DLOGTIME}$ is such that the input is given on a tape which has [random access](https://en.wikipedia.org/wiki/Random_access) so you can "read" parts of it without "counting" the time needed to move the end. If so, then binary search solves it quite straightforwardly, and maybe this is what you meant... |
null |
1. $L_a = \{ a^*cw \mid w \in \{a,b \}^* \land |w|_a = |w|_b \}$
>! $L_a \cup d^* = L_a'$
$L_a' = \{ \{a,d\}^*cw \mid w \in \{a,b,d \}^* \land |w|_a + |w|_d = |w|_b \}$ (union?)
>! $L_a' \cap a^*cw = L_a''$
$L_a'' = \{ d^*cw \mid w \in \{a,b \}^* \land |w|_a = |w|_b \}$
>! homomorphism $ h... |
As follows [from my previous question][1], I've been playing with the [Riemann hypothesis][2] as a matter of recreational mathematics. In the process, I've come to a rather interesting recurrence, and I'm curious as to its name, its reductions, and its tractability towards the solvability of the gap between prime numbe... |
The idea is to decide nondeterministically at the beginning how much the word is cycled, and have a copy of the automaton for every case. In terms of the automaton, that means that we guess in which state $D$ would have been after consuming a word's prefix (which is a suffix of our input), and start in that state.
N... |
I am trying to solve the following computational geometry problem.
>Let $S$ be a set of $n$ axis-parallel rectangles in the plane, so that the bottom edge of each rectangle in $S$ lies on the $x$-axis.
>1. What is (an upper bound on) the combinatorial complexity of the union $K$ of the rectangles in $S$?
>2. Gi... |
Area of the union of rectangles anchored on the x-axis |
In a directed graph with a starting node and an ending node, how to find a small (doesn't have to be smallest. <10 for example) set S of nodes such that every possible path from the starting node to the ending node contains at least one member of set S. The graph may have loops. This may be NP hard. Is there an approxi... |
how to find a small set of vertexes such that all paths in the graph from the start node to the end node will contain at least one of these vertexes? |
|graphs| |
If an encryption algorithm is meant to convert a string to another string which can then be decrypted back to the original, how could this process involve any randomness?
Surely it has to be deterministic, otherwise how could the decryption function know what factors were involved in creating the encrypted string? |
How can encryption involve randomness? |
|cryptography|randomness| |
Is "party attendance" type of problems solvable in Prolog? E.g.
*"Burdock Muldoon and Carlotta Pinkstone both said they would come if Albus Dumbledore came. Albus Dumbledore and Daisy Dodderidge both said they would come if Carlotta Pinkstone came. Albus Dumbledore, Burdock Muldoon, and Carlotta Pinkstone all said t... |
Identifying Constraint satisfaction problem |
|logic| |
Finding the smallest number of *edges* instead of vertices is the famous Minimum Cut problem which can be solved using any of the [Max-Flow-Min-Cut][1] algorithms. Picking vertices is a specific case of the [generalised max-flow-min-cut theorem][2] and similar algorithms can be used to solve it. In any case, it can be ... |
Both the encryption and the decryption algorithms can be randomised as long as you can prove some theorem that encryption followed by decryption will give you the original message *most of the times*.
Why would anyone want such an encryption scheme? Because: 1) there exist situations where we don't want to be right ... |
Regular languages are closed under intersection. This often allows to cut away all parts of a language that are not needed to show non-regularity.
>! For $L_a$, the part right of $c$ is sufficient; try to intersect with a regular expression that lets you keep all words $ca^nb^n$ and work from there. For $L_b$, try t... |
Just to cite an example, in [RSA encryption][1], you need to generate two primes $p$ and $q$ and an integer $e$ which will be used to create your public and private keys.
If you generate any of these values in a deterministic way, then their generation can be reproduced, potentially compromising your encryption. If ... |
Regular languages are closed under intersection. This often allows to cut away all parts of a language that are not needed to show non-regularity. Complementation serves a similar purpose: if the original language is "complicated", the complement may be simpler so work with (in terms of other closure properties).
>!... |
There can be more than one ciphertext that maps back to the same plaintext. In mathematical terms, the encryption algorithm must be injective so that you can recover the plaintext for the ciphertext, but this does not prevent the ciphertext from encoding more information than the plaintext.
As a concrete example, co... |
|logic|semantics|constraint-programming|prolog| |
Is "party attendance" type of problems solvable in Prolog? For example:
> Burdock Muldoon and Carlotta Pinkstone both said they would come if Albus Dumbledore came. Albus Dumbledore and Daisy Dodderidge both said they would come if Carlotta Pinkstone came. Albus Dumbledore, Burdock Muldoon, and Carlotta Pinkstone al... |
Can constraint satisfaction problems be solved with Prolog? |
In a directed graph with a starting node and an ending node, how to find a small (doesn't have to be smallest. <10 for example) set S of nodes such that every possible path from the starting node to the ending node contains at least one member of set S. The graph may have loops. This may be NP hard. Is there an approxi... |
Finding small node sets that can not be avoided on paths from source to sink |
|algorithms|graphs| |
You have not stated what type of encryption we are discussing, but let me point out what is really needed for the security of the cartographic protocols (in addition what is stated in other answers).
What we really need is this: the *keys* should be generated randomly (this can be done in collaboration as in public... |
|logic|constraint-programming|prolog|logic-programming| |
null |
We are given a set 2-dimensional points $|P| = n$ and an integer $k$. We must find a collection of $k$ circles that enclose all the $n$ points such that the radius of the largest circle is as large as possible. In other words, we must find a set $C = \{ c_1,c_2,\ldots,c_k\}$ of $k$ center points such that the cost func... |
Runtime of the optimal greedy $2$-approximation algorithm for the $k$-clustering problem |
The problem can be indeed viewed geometrically in a way that we would like to cover the $V$ points by $k$ balls, where the radius of the largest ball is minimized.
$O(nk)$ is indeed quite simple to achieve but one can do better. [Feder and Greene, Optimal algorithms for approximate clustering, 1988](http://theory.s... |
For the purpose of proving that they are not regular, what closure properties can I use to transform the languages
1. $L_a = \{ a^*cw \mid w \in \{a,b \}^* \land |w|_a = |w|_b \}$ and
2. $L_b = \{ab^{i_1}ab^{i_2}\ldots ab^{i_n} \mid i_j∈\mathbb N \land \exists j∈[1,n] \ i_j \not= j \}$
to $L := \{ a^nb^n... |
I think the problem is that you have cycles, e.g.
admit(CP) :- admit(AD).
admit(AD) :- admit(CP).
So to work out whether `admit(CP)` holds Prolog will try to determine whether `admit(AD)` holds, which it will do by checking whether `admit(CP)` holds, and so on until stack overflow.
I don't believe van... |
I have a "smarter" version of Bellman-Ford here:
This version is more witty about choosing the edges to relax.
//Queue Q; source s; vertices u, v; distance to v d(v)
Q ← s // Q holds vertices whose d(v) values have been updated recently.
While (Q !empty)
{
u ← Dequeue(Q)
fo... |
Bellman-Ford variation |
|graphs|shortest-path| |
null |
I have a "smarter" version of Bellman-Ford here; this version is more clever about choosing the edges to relax.
//Queue Q; source s; vertices u, v; distance to v d(v)
Q ← s // Q holds vertices whose d(v) values have been updated recently.
While (Q !empty) {
u ← Dequeue(Q)
for each neighbo... |
|algorithms|graphs|runtime-analysis|shortest-path| |
As follows [from my previous question][1], I've been playing with the [Riemann hypothesis][2] as a matter of recreational mathematics. In the process, I've come to a rather interesting recurrence, and I'm curious as to its name, its reductions, and its tractability towards the solvability of the gap between prime numbe... |
As follows [from my previous question][1], I've been playing with the [Riemann hypothesis][2] as a matter of recreational mathematics. In the process, I've come to a rather interesting recurrence, and I'm curious as to its name, its reductions, and its tractability towards the solvability of the gap between prime numbe... |
Most of the computers available today are designed to work with binary system. It comes from the fact that information comes in two natural form, **true** or **false**.
We humans accept another form of information called "maybe" :)
I know there are ternary processing computers but not much information about them.... |
Ternary processing instead of Binary |
|computability|computer-architecture| |
Most of the computers available today are designed to work with binary system. It comes from the fact that information comes in two natural form, **true** or **false**.
We humans accept another form of information called "maybe" :)
I know there are ternary processing computers but not much information about them.... |
null |
There is some information in the article "[Ternary computer][1]" on Wikipedia. To address some of your specific questions:
- Feasibility: [Yes][2].
- Memory: Can be implemented via a [Josephson junction][3].
- Advantages: Higher density of information per bit can lead to more compact data representations.
... |
> Are there difficulties differentiating between 3 levels of signal?
That's more electronic than computer science (and the issue could be different with other technology). The 2 levels signals we use are generated by putting transistors in a saturation state(*). They behave like switches and the whole technology is ... |
A ternary hardware system could about something else than $\{\mbox{yes},\mbox{no},\mbox{maybe}\}$ but using arbitrary $\{0,1,2\}$ or $\{0,1,-1\}$. The main inconvenient about such a thing is that the cost of reading a ternary digit is way bigger than for a bit for the same risk of error. (Bigger enough to be less effic... |
Is there *a need* for $L\subseteq \Sigma^*$ to be *infinite* to be undecidable?
I mean what if we choose a language $L'$ be a *bounded finite version of* $L\subseteq \Sigma^*$, that is $|L'|\leq N$, ($N \in \mathbb{N}$), with $L' \subset L$. Is it possible for $L'$ to be an undecidable language?
I see that the... |
From this statement
> As there is no surjection from $\mathbb{N}$ onto $\mathcal{P}(\mathbb{N})$, thus there must exist an undecidable language.
I would like to understand why similar reasoning does not work with a *finite* set $B$ which also has no surjection onto $\mathcal{P}(B)$! (with $|B|=K$ and $K \in \ma... |
null |
There is one usage of a ternary alphabet $\{\mbox{yes}, \mbox{no}, \mbox{maybe}\}$. In signal transferring you can use $\mbox{maybe}$ result of the transfer to increase the capacity of an information channel.
The channel where you have a probability $\alpha$ that $\mbox{yes}\rightarrow\mbox{no}$ or $\mbox{no}\righta... |
Knuth considered this idea in V1 of TAoCP. Ho observed that we would need a new device to replace the flip-flop, and he proposed calling it the **flip-flap-flop**. Was he serious? Well, Knuth has quite a sense of humor.
But it looks like somebody has [implemented the flip-flap-flop](http://www.goldenmuseum.com/1411F... |
null |
I'm trying to prove that "every well-balanced orientation of an eulerian graph is eulerian". I want to prove it by showing that for any two vertices u and v, their local arc connectivities P'_D(u,v)=P'_D(v,u) for every well-balanced orientation of an eulerian graph.
|
How to prove "every well-balanced orientation of an eulerian graph is eulerian" |
|graphs| |
In the usual definition of probabilistic poly-time machine it is said that the machine halts in poly-time for all inputs.
Is the intention really to say that the machine halts for all inputs, or that if it halts it must be in poly-time? |
Probabilistic poly-time machine always halts in all inputs? |
|complexity-theory|turing-machines| |
Perhaps you mean [PP](http://en.wikipedia.org/wiki/PP_%28complexity%29).
>A language L is in PP if and only if there exists a probabilistic Turing machine M, such that
>
>* M runs for polynomial time on all inputs
>* For all x in L, M outputs 1 with probability strictly greater than 1/2
>* For all x not in L, M... |
Perhaps you mean [PP](http://en.wikipedia.org/wiki/PP_%28complexity%29).
>A language L is in PP if and only if there exists a probabilistic Turing machine M, such that
>
>* M runs for polynomial time on all inputs
>* For all x in L, M outputs 1 with probability strictly greater than 1/2
>* For all x not in L, M... |
{"Voters":[{"Id":140,"DisplayName":"Vor"}]} |
Perhaps you mean [PP](http://en.wikipedia.org/wiki/PP_%28complexity%29).
>A language L is in PP if and only if there exists a probabilistic Turing machine M, such that
>
>* M runs for polynomial time on all inputs
>* For all x in L, M outputs 1 with probability strictly greater than 1/2
>* For all x not in L, M... |
{"Voters":[{"Id":140,"DisplayName":"Vor"}]} |
I'm trying to prove that "*every well-balanced orientation of an eulerian graph is eulerian*".
I want to prove it by showing that for any two vertices $u$ and $v$, their local arc connectivities $P'_D(u,v)=P'_D(v,u)$ for every well-balanced orientation of an eulerian graph.
|
null |
Are there any advantages of having more than 2 hidden layers in a Neural Network?
I've seen some places that recommend it, others prove that there is no advantage.
Which one is right? |
How many layers should a neural network have? |
|neural-networks| |
Since the number of edges is $n-1$, the graph is a tree. Take a starting vertex $v$ in $V(G)$. Now start walking in any direction, and keep walking, without repeating a vertex. Since $G$ is finite, and does not contain a cycle, this process will eventually stop in a vertex $u$ of degree 1. If $v$ also had degree 1, we ... |
One very good resource is the [Neural Network FAQ][1]. The question depends a lot on your problem. If the problem is linear in nature, there is no reason to have any hidden layers. If the problem is non-linear, often a single hidden layer with around 10 hidden neurons will do the trick.
[1]: ftp://ftp.sas.co... |
null |
I know the minimum-cut derived from max flow method could be one qualified cut. But I want several(may be hundreds) small cuts as candidates. The cuts don't have to be minimum-cut, as long as it is small(in weight). Thanks. |
In s-t weighted directed graph, how to find MANY small cuts? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.