instruction
stringlengths
0
29.8k
⌀
|finite-automata|proof-assistants|
|automata|finite-automata|nondeterminism|proof-assistants|automated-theorem-proving|
The proof would be trivial: all DFAs are also NFAs. If you somehow insist in proving that for every DFA there exists an equivalent NFA that is not also a DFA, then it suffices to add a new initial state $q$ along with an $\varepsilon$-transition from $q$ to the old initial state.
Every DFA is an NFA by definition, so you only need to prove that for every NFA there exists an equivalent DFA.
Suppose that I have a space $\mathcal{X} = \{x_1, x_2, \ldots, x_n\}$ and a set $\mathcal{S} \subseteq \mathcal{X}$ with $|\mathcal{S}|$ many elements. A naive set membership function $f:\mathcal{X} \to \{\text{in},\text{not in}\}$ would look like this: $$ f: x \mapsto \begin{cases} \text{in $\mathcal{S}$} & ...
Any approximate set membership function with logarithmic space complexity? (wiithout insanely high error rate)
My minimax graph search has considered three options at the root level of a graph. - The first option, `A`, yields a solution with cost 10. - The second option, `B`, was not fully investigated. It has a solution with cost 20, and the lower limit to any possible solution is 15. - The third option, `C`, was also not...
Alpha beta pruning does not detect a candidate
|minimax|pruning|
I'll start with some definitions to simplify the rest of the message. Let's denote $f_0 = b, \ f_1 = a, \ f_n = f_{n-1} \cdot f_{n-2}$, where $\cdot$ stands for concatenation of two words. We call $f_n$ the $n$-th Fibonacci word. Let's also denote $f := \lim_{n \to \infty} f_n$ (the Fibonacci word). Let $s_{k}$ be a...
Periodicity in Fibonacci words
|combinatorics|word-combinatorics|
[This](https://en.wikipedia.org/wiki/Bloom_filter#Probability_of_false_positives) and [this](https://hur.st/bloomfilter/?n=100&p=&m=10&k=1) agree that there will be near 100% false positive rate with Bloom's filter should number of elements in the set ($n$) be greater than the number of bits in the filter ($m$). E.g...
What is the point of Bloom's filter if its false positive rate is so high?
[This](https://en.wikipedia.org/wiki/Bloom_filter#Probability_of_false_positives) and [this](https://hur.st/bloomfilter/?n=100&p=&m=10&k=1) agree that there will be near 100% false positive rate with Bloom's filter should number of elements in the set ($n$) be greater than the number of bits in the filter ($m$). E.g...
No, your proposed scheme with cryptographic hash functions does not do a better job than Bloom filters. Your scheme outputs $10n$ bits, which is way more than $m$ bits. You are comparing a Bloom filter that uses just 10 bits to your scheme, which uses 1000 bits. Obviously those two are not comparable. Obviously a s...
null
if we define halting problem as follows $ \begin{align*} h(m,n) &= \begin{cases} 1 & \text{if program $m$ halts on input $n$} \\ 0 & \text{otherwise} \\ \end{cases} \end{align*} $ and we have two sometimes correct solutions $f$ and $g$ for $h$ that are always correct if they agree but f...
No, your proposed scheme with cryptographic hash functions does not do a better job than Bloom filters. Your scheme outputs $10n$ bits, which is way more than $m$ bits. You are comparing a Bloom filter that uses just 10 bits to your scheme, which uses 1000 bits. Obviously those two are not comparable. Obviously a s...
null
The SAT problem is a **decision** problem. It means that an algorithm that solves SAT must answer `true` or `false`, and not necessarily find a satisfying assignment. However, as many decision problems, there is a **functional** problem associated to SAT, that asks to find a satisfying assignment when there exists o...
if we define halting problem as follows $ \begin{align*} h(m,n) &= \begin{cases} 1 & \text{if program $m$ halts on input $n$} \\ 0 & \text{otherwise} \\ \end{cases} \end{align*} $ and we have two sometimes correct solutions $f$ and $g$ for $h$ that are always correct if they agree but f...
If you have variables x1 to xn, and you decide in polynomial time whether the problem can be satisfied or not, then if it can be satisfied, you set x1 = true and check if it can still be satisfied. If not you set x1 = false, which can be satisfied. Then you set x2 = true, and if that cannot be satisfied you set x2 ...
What we need to prove is that - the smallest period for $s_1$ is 1. - the smallest period for $s_2$ and for $s_3$ is 2. - the smallest period for $s_i$ is $F_{k-1}$ for all $F_k-1\le i\le F_{k+1}-2$, where $k\ge3$. ------ The first two items are easy to verify. ------ Let $k\ge3$. You have proved tha...
I'll start with some definitions to simplify the rest of the message. Let's denote $f_0 = b, \ f_1 = a, \ f_n = f_{n-1} \cdot f_{n-2}$, where $\cdot$ stands for concatenation of two words. We call $f_n$ the $n$-th Fibonacci word. Let's also denote $f := \lim_{n \to \infty} f_n$ (the Fibonacci word). Let $s_{k}$ be t...
|combinatorics|strings|substrings|word-combinatorics|
the smallest periods of the prefixes of the Fibonacci word
The smallest periods of the prefixes of the Fibonacci word
I'll start with some definitions to simplify the rest of the message. Let's denote $f_0 = b, \ f_1 = a, \ f_n = f_{n-1} \cdot f_{n-2}$, where $\cdot$ stands for concatenation of two words. We call $f_n$ the $n$-th Fibonacci word. Let's also denote $f := \lim_{n \to \infty} f_n$ (the Fibonacci word). Let $s_{k}$ be t...
i can't comment as i haven't yet touched the benchmark of 50 reputations. I would like to make your work a bit clearer.You have used 3 variables although even 2 are sufficient . a^n! let n=m , now consider this, |w|=|xz|+i|y| also , m! has two parts k! = |xz| and j = i.|y| now we know j<=m , consid...
What we need to prove are - the smallest period for $s_1$ is 1, which is trivially true. - the smallest period for $s_i$ is $F_{k-1}$ for all $F_k-1\le i\le F_{k+1}-2$, where $k\ge3$. ------ Let $k\ge3$. You have proved that the smallest period of $f_k=s_{F_k}$ is $F_{k-1}$. - The smallest period of any stri...
i can't comment as i haven't yet touched the benchmark of 50 reputations. I would like to make your work a bit clearer.You have used 3 variables although even 2 are sufficient . a^n! let n=m , now consider this, |w|=|xz|+i|y| also , m! has two parts k! = |xz| and j = i.|y| now we know j<=m , consid...
Took time but finally found how to derive the above equation. This thing requires the knowledge of continuous markov chains. I read about them from these two videos which was enough to understand the concept. <br> [Video 1][1] <br> [Video 2][2] Now the derivation is [here on wikipedia][3]. Basically, our system ...
There are a few different probabilistic methods that can be used to try and solve undecidable problems. One such method is called Markov chains, which are a type of stochastic process. Essentially, a Markov chain is a mathematical model that describes the evolution of some system over time, using probabilities to calcu...
Subset Product Problem is $NP-Complete$. Given a promise that the product contains exactly 1 occurrences of each of its prime factor is the problem still $NP-Complete$? Seems to be the case but couldn't find any references. Can someone confirm?
Is this version of Subset Product Problem NPComplete?
|complexity-theory|
null
Let's say we have some distinct sets each containing a number of line segments. I want to choose the minimum number of sets such that I will obtain a line from 0 to L with the largest gap being X long. For example, let's say we have the sets A, B, and C as given below. L is 45 and X is 4. If we take A, there is ...
Designing an algorithm to choose the minimum number of sets containing line segments
|algorithms|selection-problem|
The problem is NP-hard in general. Consider the setting where X=0, and each line segment has length 1. Then this becomes an instance of the [set cover problem](https://en.wikipedia.org/wiki/Set_cover_problem), which is well-known to be NP-hard. So, you can't expect any efficient algorithm that always solve this prob...
Yes, by reduction from [exact cover](https://en.wikipedia.org/wiki/Exact_cover).
In addition to D.W.s answer, notice that the constraint on the gap is irrelevant since you can always extend each interval endpoint by $X/2$ (and shorten the endpoints of the line by $X/2$). Then the problem can be reduced to set cover: create an item for each maximal (w.r.t. inclusion) sub-interval of $[0,L]$ that...
In addition to D.W.s answer, notice that the constraint on the gap is irrelevant since you can always extend each interval endpoint by $X/2$ (and shorten the endpoints of the line by $X/2$). Then the problem can be reduced to set cover: create an item for each maximal (w.r.t. inclusion) sub-interval of $[0,L]$ that...
My minimax graph search has considered three options at the root level of a graph. - The first option, `A`, yields a solution with cost 10. - The second option, `B`, was not fully investigated. It has a solution with cost 20, and the lower limit to any possible solution is 15. - The third option, `C`, was also not...
In addition to D.W.'s answer, notice that the constraint on the gap is irrelevant since you can always extend each interval endpoint by $X/2$ (and shorten the endpoints of the line by $X/2$). Then the problem can be reduced to set cover: create an item for each maximal (w.r.t. inclusion) sub-interval of $[0,L]$ tha...
null
To deal with the issue cogently requires first some background. These issues can be dealt with, entirely, within an algebraic framework. Algebraically, a grammar is a system of fixed-point inequations over a certain type of partially ordered algebra, with the item represented by the grammar given in terms of the least ...
Is the problem of communication with a pre-shared database studied? If yes, what field studies it, or which researchers work on it? Let there be two parties that want to share multiple yet-to-be-defined messages. These parties want to compress future communication as much as possible. For that, they first define som...
Can a static pre-shared database reduce communication size?
|complexity-theory|information-theory|communication-protocols|communication-complexity|
I will assume you are looking for an information-theoretic view, where the goal is to come up with an encoding/compression scheme to minimize the length of the encoded data, without worrying about computational issues (how efficiently the data can be encoded or decoded). I'll also assume that you want lossless compres...
null
Apologies for the vague title. This decision problem has applications to graph coloring but I have not found a name for it in the literature. I am trying to improve my algorithm for a decision problem. The problem input is a graph and hypergraph which have the same vertex set, $(V, E, H)$ where $V$ is the set of ver...
Is there an algorithm for this decision problem that is better than brute-force?
|algorithms|graphs|np|decision-problem|
null
The most concrete concept mentioned in that definition is _a program_, which is created (notice: not usually written) by a programmer. Okay, maybe a programmer is a more concrete concept, but this is beside the point. I _say not usually written_ because programs are modernly written in high-level programming languag...
I can solve this question when A and B are sorted. However, the question states A and B are unsorted, and I cannot think of a solution that solves in O(n) time. Also, no hashing or linear time sorting is allowed.
If I two unsorted arrays (say A and B) such that all items of A belongs to B (A ⊂ B), find the smallest in B that don't occur in A in linear time?
|algorithms|time-complexity|
null
null
## Description This is an exercise for Formal Language course, I'm asked to find a grammar for language: $L = {0^i1^ic0^j1^j | j = i+1}$ As an example: 01c0011 can be generated using this language, so does 0011c000111. ## What I've tried The difficulty is around the `j = i + 1` controlling, I've tried s...
Context free grammar for $L={0^i1^ic0^j1^j | j = i+1}$
|formal-languages|automata|context-free|formal-grammars|
null
There's this problem that I was solving and even though I have an O(n) solution but still trying to make sense of the pattern. The problem being: determine the number of pairs of the same numbers. For e.g for an array `[1,2,3,1,2,1]`. The 4 possible pairs include: ``` [1,1] // index (0,3) [1,1] // index (0,5) ...
Understanding the logic for finding the count of same-element-pair
|algorithms|time-complexity|
if we define halting problem as follows $ \begin{align*} h(m,n) &= \begin{cases} 1 & \text{if program $m$ halts on input $n$} \\ 0 & \text{otherwise} \\ \end{cases} \end{align*} $ and we have two sometimes correct solutions $f$ and $g$ for $h$ that are always correct if they agree but f...
if we define halting problem as follows $ \begin{align*} h(m,n) &= \begin{cases} 1 & \text{if program $m$ halts on input $n$} \\ 0 & \text{otherwise} \\ \end{cases} \end{align*} $ and we have two sometimes correct solutions $f$ and $g$ for $h$ that are always correct if they agree but f...
Suppose that I have two random processes. Process $X$ has probability 0.5 to be in state A and probability 0.5 to be in state B. Process $Y$ has probability 0.4 to be in state A and probability 0.6 to be in state B. State B has two substates: $B_1$ and $B_2$. For both processes, the two substates are equally likely....
Which system has higher entropy?
|entropy|
|information-theory|entropy|
## Description This is an exercise for Formal Language course, I'm asked to find a grammar for language: $L = \{ 0^i1^ic0^j1^j | j = i+1 \}$ As an example: 01c0011 can be generated using this language, so does 0011c000111. ## What I've tried The difficulty is around the `j = i + 1` controlling, I've tri...
Context free grammar for $L= \{0^i1^ic0^j1^j | j = i+1 \}$
Reasoning: - you are asked the *smallest* in $B$; this hints that the solution will be comparison-based. - with an $O(n)$ budget, no comparison-based sort is possible; the best you can do with comparisons is to heapify ! - wonder what happens if you heapify the two arrays and compare them. Notice that after...
null
It is to be expected that you have difficulties finding a context-free grammar since the language is not context-free. Indeed, suppose it is; it should verify the pumping lemma for context-free languages. Let $n$ be the pumping length and $u = 0^n1^nc0^{n+1}1^{n+1} \in L$. The pumping lemma states that there exists ...
It is to be expected that you have difficulties finding a context-free grammar since the language is not context-free. Indeed, suppose it is; it should verify the pumping lemma for context-free languages. Let $n$ be the pumping length and $u = 0^n1^nc0^{n+1}1^{n+1} \in L$. The pumping lemma states that there exists ...
Shannon entropy computes the average number of bits needed to represent the outcomes. Your first probability distributions are: D1: 0.5, 0.5 and D2: 0.4, 0.6, the first of which has higher shannon entropy (maximal in fact). In the second situation your distributions are: D3: 05, 0.25 and 0.25 and D4: 0.4, 0.3 a...
[![enter image description here][1]][1]I used a vector to determine the collision between a line and a circle. Here's the way I thought of it in the beginning. 1. When the ball collides with a straight line, it finds a normal line passing through the center point. 2. Take the coordinates before the ball colli...
Is there an algorithm that causes a straight line and a circle to collide and bounce?
|algorithms|
So, I have a set of 2D points with real valued positions. I want to find a set of N adjacent unit squares that contains the most points possible. If it's easier, this could be a set of N adjacent (or overlapping) disks. Any idea how I could do that? Thank you :)
Find the N adjactent unit squares that contain the most 2D points
|algorithms|
null
Find the intersection point between the parallel to the line at distance R and the trajectory of the center of the ball. Now notice that the sum of the incoming and outgoing direction vectors (let I and O) is parallel to the line, corresponding to a vector α.D of unknown length. I + O = α.D The by express...
null
@Nathaniel has actually given a nice proof and standard one. (Wanted to write my answer as comment but having less points.) I would like to conclude with a short point while you continue with your course it'll be helpful. To identify RL: if language is finite => then it's regular else if its infinite , sing...
@Nathaniel has actually given a nice proof and standard one. (Wanted to write my answer as comment but having less points.) I would like to conclude with a short point while you continue with your course it'll be helpful. To identify RL: if language is finite => then it's regular else if its infinite , sing...
During the run of Ford Fulkerson algorithm if we label each edge with d(v) where it means the shortest path distance from source to vertex v in residual graph. Is it possible that for some vertex this value decreases at any execution stage? I tried to find such an example, but it seems the vertices are getting away aft...
Can distance from source to any of the vertex decrease during the run of Ford Fulkerson algorithm?
|network-flow|ford-fulkerson|
During the run of Ford Fulkerson algorithm if we label each vertex with d(v) where it means the shortest path distance from source to vertex v in residual graph. Is it possible that for some vertex this value decreases at any execution stage? I tried to find such an example, but it seems the vertices are getting away a...
You want a solution with the lowest cost, your opponent wants a solution with the highest cost. You examined A and it gave you a cost of 10. You examined B. You tried to find the worst move that the opponent could do on you, but any opponent move with a worst cost of "more than 10" can be ignored. There was no opponent...