instruction stringlengths 0 29.8k ⌀ |
|---|
|algorithms|formal-languages| |
About String Matching, how can I prove that
$$δ(q,a) = δ(π\lbrack q\rbrack,a) \ \mathrm{if}\ q = m \ \mathrm{or}\ P[q+1]\not=a$$
where:
<ol>
<li>$q$ is a finite automaton's state</li>
<li> $a$ is a generic character</li>
<li>δ is the automaton's transition function</li>
<li> $P[1..m]$ is the Pa... |
Prove transition function with prefix function |
|algorithms|automata|finite-automata| |
About String Matching, how can I prove that
$$δ(q,a) = δ(π\lbrack q\rbrack,a) \ \mathrm{if}\ q = m \ \mathrm{or}\ P[q+1]\not=a$$
where:
<ol>
<li>$q$ is a finite automaton's state</li>
<li> $a$ is an arbitrary symbol from the alphabet</li>
<li>δ is the automaton's transition function</li>
<li> $... |
There are extremely *deep* and *pervasive* connections between logic and computer science. In understanding what they might be, keep in mind that computer science is also called "information technology" or "informatics", meaning that computer systems capture, process and deliver information. Well, logic is a similar ... |
As an amplification of sdcvvc's hint: You can find a context-free language $L$ such that $A(L) = \{a^m b^m c^m \mid m\geq 0\}$, which as you probably know is not context-free.
So we want to find $L$ such that if $ww\in L$, then $w$ has the form $a^m b^m c^m$. We might as well have $L$ be a sublanguage of $a^*b^*c^... |
About String Matching, how can I prove that
$$δ(q,a) = δ(π[q],a) \text{ if}\ q = m \text{ or } P[q+1]\not=a$$
where:
* $q$ is a finite automaton's state
* $a$ is an arbitrary symbol from the alphabet
* $δ$ is the automaton's transition function
* $P[1..m]$ is the Pattern
* $m$ is the length of $P$
* $π$... |
null |
About String Matching, how can I prove that
$$\delta(q,a) = \delta(\pi[q],a) \text{ if}\ q = m \text{ or } P[q+1]\not=a$$
where:
* $q$ is a finite automaton's state
* $a$ is an arbitrary symbol from the alphabet
* $\delta$ is the automaton's transition function
* $P[1..m]$ is the Pattern
* $m$ is the len... |
That text describes the following (Python) pseudocode:
subs = a list of string pairs
As = a list of integers
Bs = a list of integers
def run(state, pc):
if pc == N: return
if state.find(subs[pc][0]) != -1:
run(state.replace(subs[pc][0],subs[pc][1],1), Bs[pc])
el... |
That text describes the following (Python) pseudocode:
subs = a list of string pairs
As = a list of integers
Bs = a list of integers
def f(state, pc):
if pc == N: return (state, pc)
if state.find(subs[pc][0]) != -1:
return (state.replace(subs[pc][0],subs[pc][1],1), Bs[... |
I am wondering if there are any connection between convex polygon and castable object? What can we say about castability of the object if we know that the object is convex polygon and vice versa.
Let's gather together few basic things that we have to know.
>The object is castable if it can removed from the mold.
... |
Connection between castability and convexity |
|computational-geometry| |
If there is a way to identify if two sets of points can be separated by a line?
>We have two sets of points $A$ and $B$ if there is a line that separates $A$ and $B$ such that all points of $A$ and only $A$ on the one side of the line, and all points of $B$ and only $B$ on the other side.
The most naive algorithm... |
Line separates two sets of points |
|algorithms| |
If there is a way to identify if two sets of points can be separated by a line?
>We have two sets of points $A$ and $B$ if there is a line that separates $A$ and $B$ such that all points of $A$ and only $A$ on the one side of the line, and all points of $B$ and only $B$ on the other side.
The most naive algorithm... |
If I remember correctly [support vector machines][1] construct seperating hyperplanes. If you choose dimension $2$ the hyperplane becomes of course a line. You might have to check if there are additional assumptions to be met. In two dimensions the whole approach might simplify considerably so the runtime might be bett... |
The problem can be viewed 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(kV)$ is indeed quite simple to achieve but one can do better. [Feder and Greene, Optimal algorithms for approximate clustering, 1988](http://theory.stanford.edu/~tomas/cl... |
null |
The property of your two data sets is that of [linear separability](http://en.wikipedia.org/wiki/Linear_separability), simply, that there is a line that separates them.
A lot of machine learning is devoted to finding [linear classifiers](http://en.wikipedia.org/wiki/Linear_classifier), which are lines that perform t... |
The property of your two data sets is that of [linear separability](http://en.wikipedia.org/wiki/Linear_separability), simply, that there is a line that separates them.
A lot of machine learning is devoted to finding [linear classifiers](http://en.wikipedia.org/wiki/Linear_classifier), which are lines that perform t... |
null |
I am trying to attack TAOCP once again, given the sheer literal heaviness of the volumes I have trouble committing to it seriously. In TAOCP 1 Knuth writes, page 8, basic concepts::
> Let $A$ be a finite set of letters. Let $A^*$ be the set of all strings in $A$ (the set of all ordered sequences $x_1$ $x_2$ ... $x_n... |
Please explain this formal definition of computation |
|formal-languages|turing-machines|computation-models| |
|computational-geometry| |
|computer-architecture|compilers| |
This is a proper answer but feel free to correct me I think I did not get the right definitions. This is why I begin with simple facts that should be checked first.
I suppose your are talking about $\vec v$-castability of a "open" polyhedron.
1. Indeed it seems that no "closed" polyhedron is $\vec v$-castable.
2... |
The pumping lemma provides a sufficient condition for a language to be non-regular, it is not a necessary condition. This is an example of a language for which the pumping condition holds, so you cannot prove that it is non-regular with (the basic version of) the pumping lemma.
When you see this language definition,... |
The pumping lemma provides a sufficient condition for a language to be non-regular, it is not a necessary condition. This is an example of a language for which the pumping condition holds, so you cannot prove that it is non-regular with (the basic version of) the pumping lemma.
When you see this language definition,... |
There is no such thing as “the” invariant: any loop has plenty of invariants. You need to find an interesting invariant. Since you're trying to prove that the loop computes a matrix multiplication, your invariant must imply that when $i=j=k=n$, the coefficients of $C$ are those of the matrix product $A \times B$, i.e.
... |
null |
When setting up an access point and selecting WPA2, one must manually enter a pre-shared key (a password), PSK, into both the AP and the STA.
Both parties, AP and STA, must authenticate each other. But they have to do so without revealing the PSK. Both have to proof to the other party that they know the PSK without... |
Is WPA2 with pre-shared key an example of a zero-knowledge proof? |
|untagged| |
Reading a book I was redirected to ["On holy wars and a plea for peace"][1] paper by Danny Cohen, which covers the "holy war" between big-endians and little-endians considering byte-order.
Reaching the summary of the memory section I got confused as the author sais:
> To the best of my knowledge only the Big-End... |
Big-Endian/Little-Endian argument - paper by Danny Cohen |
|terminology| |
|cryptography|authentication| |
I am trying to find a $\Theta$ bound for the following recurrence equation:
$$ T(n) = 2 T(n/2) + T(n/3) + 2n^2+ 5n + 42 $$
I figure Master Theorem is inappropriate due to differing amount of subproblems and divisions. Also recursion trees do not work since there is no $T(1)$ or rather $T(0)$.
|
Solving Recurrence Equations containing two Recursion Calls |
|complexity-theory|recursion| |
You can use the more general [Akra-Bazzi][1] method.
In your case, we would need to find $p$ such that
$$ \frac{1}{2^{p-1}} + \frac{1}{3^p} = 1$$
(which gives $p \approx 1.364$)
and we then have
$$T(x) = \Theta(x^p + x^p\int_{1}^{x} t^{1-p} \text{d}t) = \Theta(x^2)$$
A simpler method would be to set ... |
$$ 3 T(n/3) + 2n^2+ 5n + 42 \le \\2 T(n/2) + T(n/3) + 2n^2+ 5n + 42 \le \\3 T(n/2) + 2n^2+ 5n + 42$$
First and third one by master theorem are $\Theta(n^2)$ so your problem is $\Theta(n^2)$.
---
P.S: For ending with this proof, you should prove that your function is increasing function. |
null |
null |
|computational-geometry|machine-learning| |
Reading a book I was redirected to ["On holy wars and a plea for peace"][1] paper by Danny Cohen, which covers the "holy war" between big-endians and little-endians considering byte-order.
Reaching the summary of the memory section I got confused as the author sais:
> To the best of my knowledge only the Big-End... |
Yes, recursion trees do still work! It doesn't matter at all whether the base case occurs at $T(0)$ or $T(1)$ or $T(2)$ or even $T(10^{100})$. It also doesn't matter what the actual value of the base case is; whatever that value is, it's a constant.
Seen through big-Theta glasses, the recurrence is $T(n) = 2T(n/2)... |
In authentication you often come accross zero-knowledge password proof (ZKPP). EAP itself is a rather generic framework and it might involve revealing the identity of the client for instance to transfer it to the next layer of authentication such as RADIUS.
PACE (BSI TR-03110) is one example of ZKPP protocols used f... |
null |
Reading a book I was redirected to ["On holy wars and a plea for peace"][1] paper by Danny Cohen, which covers the "holy war" between big-endians and little-endians considering byte-order.
Reaching the summary of the memory section I got confused as the author sais:
> To the best of my knowledge only the Big-End... |
Both uli and Dave Clarke correctly observe that this is a linear programming problem, even in higher dimensions (Can these two point sets be separated by a hyperplane?) and so it can be solved in polynomial time. But because your points lie in the plane, your problem can actually be solved in $O(n)$ time, where $n$ is... |
I found the P vs NP problem some time ago and I have recently worked on the subset sum problem. I have read [Wikipedia article][1] on the Subset Sum problem as well as the question [Subset Sum Algorithm][2]
I have looked the at problem and found some solutions but so far they seem to be NP,
I believe I can make... |
Subset sum, Pseudo-polynomial time dynamic programming solution? |
|dynamic-programming| |
The first statement says that there is a _system_ that consistently uses the big-endian convention for various things (instructions, registers, etc.) The second statement says that the little-endian _convention_ is more elegant ("consistent with itself").
How are these contradictory? |
You need the line `C(i:j) = 0` just before the innermost loop; otherwise, the code is incorrect.
Assuming that line is in place, here is the (strongest possible) invariant just _before_ the assignment in the innermost loop:
\begin{align*}
C_{IJ} &= \sum_{k=1}^{n} A_{Ik}B_{kJ} & \text{for all $I$ and $J$ such that ... |
You can use the more general [Akra-Bazzi][1] method.
In your case, we would need to find $p$ such that
$$ \frac{1}{2^{p-1}} + \frac{1}{3^p} = 1$$
(which gives $p \approx 1.364$)
and we then have
$$T(x) = \Theta(x^p + x^p\int_{1}^{x} t^{1-p} \text{d}t) = \Theta(x^2)$$
Note that you don't really need t... |
Let $a \neq b$ be two integers from the interval $[1, 2^n].$ Let $p$ be a random prime with $ 1 \le p \le n^c.$ Prove that
$$\text{prob}(a \equiv b \pmod{p}) \le c \ln(n)/(n^{c-1}).$$
Hint: As a consequence of the prime number theorem, exactly $n/ \ln(n) \pm O(n/\ln(n))$ many numbers from $\{ 1, \ldots, n \}$ are ... |
Prove fingerprinting |
|probability-theory|proof-assistants|randomized-algorithms| |
|algorithms|formal-languages|automata|finite-automata|string-matching| |
|algorithms|dynamic-programming| |
|terminology|computer-architecture| |
|probability-theory|information-theory|coding-theory| |
Let $a \neq b$ be two integers from the interval $[1, 2^n].$ Let $p$ be a random prime with $ 1 \le p \le n^c.$ Prove that
$$\text{Pr}_{p \in \mathsf{Primes}}\{a \equiv b \pmod{p}\} \le c \ln(n)/(n^{c-1}).$$
Hint: As a consequence of the prime number theorem, exactly $n/ \ln(n) \pm o(n/\ln(n))$ many numbers from $... |
I'm hoping to sketch out a spec for a "restricted JavaScript" which throws out a few features, and in return compiles to much faster machine code. I'll get the ball rolling:
1. Throw out dynamic typing.
2. ... (your answer here)
Consider the likes of Google, whom has released Dart, which allow programmers the fr... |
Which of JavaScript's features slow it down the most? |
|programming-languages| |
I'm hoping to sketch out a spec for a "restricted JavaScript" which throws out a few features, and in return compiles to much faster machine code. I'll get the ball rolling:
1. Throw out dynamic typing.
2. Throw out eval().
3. Throw out things like "function.arguments" {include a rationale} (not saying this is tru... |
Let's say I am trying to break all the numbers from 1 to N down into their prime factors. Once I have the factors from 1 to N-1, is there an algorithm to give me the factors of 1 to N using dynamic programming? |
Is it possible to use dynamic programming to factor numbers |
|dynamic-programming| |
|algorithms|dynamic-programming|factoring| |
I'm hoping to sketch out a spec for a "restricted JavaScript" which throws out a few features, and in return compiles to much faster machine code. I'll get the ball rolling:
1. Throw out dynamic typing.
2. Throw out eval().
3. Throw out things like "function.arguments" {include a rationale} (not saying this is tru... |
I'm hoping to sketch out a spec for a "restricted JavaScript" which throws out a few features, and in return compiles to much faster machine code. I'll get the ball rolling:
1. Throw out dynamic typing.
2. Throw out eval().
3. Throw out things like "function.arguments" {include a rationale} (not saying this is tru... |
null |
Let $a \neq b$ be two integers from the interval $[1, 2^n].$ Let $p$ be a random prime with $ 1 \le p \le n^c.$ Prove that
$$\text{Pr}_{p \in \mathsf{Primes}}\{a \equiv b \pmod{p}\} \le c \ln(n)/(n^{c-1}).$$
Hint: As a consequence of the prime number theorem, exactly $n/ \ln(n) \pm o(n/\ln(n))$ many numbers from $... |
{"Voters":[{"Id":39,"DisplayName":"Gilles"}]} |
An algorithm using dynamic programming for factoring $N$ which proceeds by factoring all integers $1$ to $N$ in order takes time at least $\Omega(N)$. There's a known algorithm that factors integers in $\tilde{O}(N)$, namely trial division. So it doesn't seem worthwhile to pursue the dynamic programming approach as sta... |
You can try to find the smallest divisor $d>1$ of $N$ by trial divison. Then the factorization of $N$ is given by that of $d$ and that of $N/d$. Since $N$ is either a prime number or has a divisor $1 < d < \sqrt{N}$, this would solve the problem. Of course, this is a dynamic solution in a very vague sense only - the ta... |
This is a proper answer but feel free to correct me I think I did not get the right definitions. This is why I begin with simple facts that should be checked first.
I suppose your are talking about $\vec v$-castability of a "open" polyhedron.
1. Indeed it seems that no "closed" polyhedron is $\vec v$-castable.
... |
|algorithms|finite-automata|strings|searching| |
|probability-theory|information-theory|integers|coding-theory| |
Is it possible to build an undecidable problem for a Linear bounded automata?(avoiding the empty set language trick) what about for a deterministic finite automaton? (put aside intractability).
I would like to get an example(if possible) of undecidable problem **without needing Turing Machine**
Is Turing complet... |
Is it possible to build an undecidable problem for a *less powerful than* Turing Maching Automata? |
|computability|undecidability|turing-machines|finite-automata| |
I would like to find the minimal number of transitions needed, to find every edge of a directed graph.
To illustrate my needs, I give a simple graph and post the result, I would like to recieve by the algorithm (Start Vertex (1), Terminating Vertex (4)):
(Because of spam protection, I removed the image graph agai... |
Algorithm to find minimal number of transitions to visit every edge of a directed graph |
|graphs| |
|algorithms|graphs| |
|probability-theory|information-theory|coding-theory|number-theory| |
I am looking for an algorithm to find the minimum number of runs needed to visit every edge of a directed graph, given a start vertex and a terminating vertex. A run is a path from the start vertex to the terminating vertex; one run may visit a node more than once.
To illustrate my needs, I give a simple graph and p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.