instruction stringlengths 0 29.8k ⌀ |
|---|
|formal-languages|pushdown-automata| |
Suppose a real-valued function class $\mathcal{F}$ with pseudo dimension less than $d$, I am wondering what is the pseudo dimension of the following function class
\begin{equation}
\mathcal{F}_2 = \{\min(f_1, f_2), \text{with } f_1,f_2\in \mathcal{F}\}
\end{equation}
where for any $x$, $\min(f_1, f_2)(x) = \min(f_1... |
pseudo dimension of the minimum of functions |
|complexity-theory|machine-learning|vc-dimension| |
I understand why L2 is not a regular language. We can use the pumping lemma to prove it
In the case of L2:
assume n = 1 and string = ab
We assume that L2 is regular, so it has "pumping length" property and it can be divided into 3 strings, x = empty string, y = a, z = b
Now we pump y, so after pumping once ... |
Why L1 := { a^n b^m | m, n ≥ 0 and m ≥ n } is regular and L2 := { a ^ n b ^ n | n>= 0 } not regular? |
|regular-languages|finite-automata|regular-expressions|pumping-lemma|theory| |
null |
So I recently rediscovered simulated annealing through a path that others seem to be well aware of. I was aware of Metropolis-Hastings as a sampling algorithm that creates a Markov-Chain whose stationary distribution is the distribution produced by normalizing some function. It's a small leap to realize that you can us... |
I try to determine if the following statement is true:
for any given language $L \subseteq A^*$ if $L$ is a context-free language then $L_1 = \{u^Rv^R \ | \ uv \in L, |u|=|v| \}$ is also a context-free language.
Initially I tried to come up with a counterexample but now I start to believe this statement could be... |
Is this language a context-free language or not? |
|formal-languages|context-free|pumping-lemma| |
Here's another perspective. Less mathematical, but I think also insightful. Using a fabulous [sort visualizer](https://xosh.org/VisualizingSorts/sorting.html#IYZwngdgxgBAZgV2gFwJYHsIwKIA8oAWwEA5gKYDK6ATsgBTDXUA0MAJtcAO4CUMA3gCgYUTCGQwsAXhiNqAOgA2ZUsgIBuYXBow6yiaikAGdTFQAeCKdQBqG3yEx4OvWQkArKalPvLPuw7CTqhwunIA2u4AujDmsk... |
I try to determine if the following statement is true:
for any given language $L \subseteq A^*$ if $L$ is a context-free language then $L_1 = \{u^Rv^R \ | \ uv \in L, |u|=|v| \}$ is also a context-free language.
Initially I tried to come up with a counterexample but now I start to believe this statement could be... |
No, $L_1$ is not necessarily context-free.
For example, let $B=\{w\in\{0,1\}^*\mid \#_0(w)=\#_1(w)\}$. Let us call a word in $\{0,1\}^*$ balanced if it contains the same number of $0$s as $1$s. So $B$ is the language of all balanced words.
A word is in $B_1$ iff it is balanced and the first half of it is also balan... |
I do not think the linked question is relevant.
Consider the context-free language $L = \{a^n b^n c^m d^m \mid m,n\ge 0\}$.
Let us consider an example string, $uv = a^3 b^3 c^8 d^8 $.
Assuming $u$ and $v$ are of equal length,
$u= a^3 b^3 c^5$ and $v= c^3 d^8 $. Thus $u^Rv^R = c^5 b^3 a^3 d^8 c^3$.
We see tha... |
The weights are provided as part of the instance: each clause is accompanied by one.
In the unweighted case, you can think of each clause as having unit weight. |
null |
Here's another perspective. Less mathematical, but I think also insightful. Using a fabulous [sort visualizer](https://xosh.org/VisualizingSorts/sorting.html#IYZwngdgxgBAZgV2gFwJYHsIwKIA8oAWwEA5gKYDK6ATsgBTDXUA0MAJtcAO4CUMA3gCgYUTCGQwsAXhiNqAOgA2ZUsgIBuYXBow6yiaikAGdTFQAeCKdQBqG3yEx4OvWQkArKalPvLPuw7CTqhwunIA2u4AujDmsk... |
No, $L_1$ is not necessarily context-free.
------
For example, let $L=\{0^n1^{3n}\mid n\ge0\}$.
If $ uv=0^n1^{3n}$ and $|u|=|v|$, then $u=0^n1^n$ and $v=1^{2n}$. We have $u^Rv^R=1^n0^n1^{2n}$.
S0 $L_1=\{1^n0^n1^{2n}\mid n\ge0\}$, which is not context-free.
|
Here's another perspective. Less mathematical, but I think also insightful. Using a fabulous [sort visualizer](https://xosh.org/VisualizingSorts/sorting.html#IYZwngdgxgBAZgV2gFwJYHsIwKIA8oAWwEA5gKYDK6ATsgBTDXUA0MAJtcAO4CUMA3gCgYUTCGQwsAXhiNqAOgA2ZUsgIBuYXBow6yiaikAGdTFQAeCKdQBqG3yEx4OvWQkArKalPvLPuw7CTqhwunIA2u4AujDmsk... |
Here's another perspective. Less mathematical, but I think also insightful. Using a fabulous [sort visualizer](https://xosh.org/VisualizingSorts/sorting.html#IYZwngdgxgBAZgV2gFwJYHsIwKIA8oAWwEA5gKYDK6ATsgBTDXUA0MAJtcAO4CUMA3gCgYUTCGQwsAXhiNqAOgA2ZUsgIBuYXBow6yiaikAGdTFQAeCKdQBqG3yEx4OvWQkArKalPvLPuw7CTqhwunIA2u4AujDmsk... |
For open addressing, I know that once you have around 70% table being filled you should resize because more than that you get collision.
But for closed addressing, I read that load factor should not exceed 1 **(m/n where m = number of items in the buckets and n = size of the table)**
otherwise trigger rehashing to... |
What is a good load factor for seperate chaining (closed addressing)? |
|algorithms|data-structures|hash-tables| |
Apologies in advanced if this is solved problem, I could not find a solution, but might just be me not knowing what to search for.
Assume we have an alphabet `Σ={a,b,c,d}` which describes a language `L`.
We save `n` many unique words of `L` in a set `S`. (e.g. `S={a, c, abc, cd, db}`).
What would be the most eff... |
Find available value in random set |
|algorithms|search-algorithms| |
To prove the claim
$$
P(Mr = 0 ) \geq \frac{1}{2}
$$
it is enough to prove it for any row vector $m = (M_{i,1},...,M_{i,n})$ that has at least one non-zero coefficient. Thus, we continue by induction on $n$.
> $n= 1 $ base case
The base case is trivial since
$$
P(mr=0) = P(r=0) = \frac{1}{2}
$$
in ... |
***Case:1***
Suppose l have one DFA which accepts the set of all strings over `{a, b}` which starts with `a`and it's complement is not starts with `a`.
[![enter image description here][1]][1]
From the above image we see that in the second diagram represents the DFA which accepts the strings which belong to c... |
Complement of DFA always give the language which is complemented? |
|finite-automata| |
I think you can still use the linear time selection algorithm (median of medians) here. Let's call this algorithm $Select$ and let the median position be $m$, which is initially equal to $n/2$.Recall that the algorithm has 3 phases:
1. Group by 5 and select median of each group
2. Choose partition element $p$, by a... |
Im trying to build my own learning track
Currently I am working on becoming a unity developer to make game or whatever is needed. I use C# within the system.
I don't feel satisfied just working within the engine and want to make my skills more broad and flexible to be able to solve a wide number of problems.
... |
what are all the domains of computer sciences? |
|software-engineering| |
null |
```
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | eps two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
``` |
```
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | eps two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
```
The rules for S, T and U produce $A^i B^j c^k$ with $i+j=k$. The rules for A and B turn them into ... |
```
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | eps two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
```
The rules for S, T and U produce $A^i B^j c^k$ with $i+j=2k$. The rules for A and B turn them into... |
Broadly speaking, computer science can be divided into [Theoretical Computer Science](https://en.wikipedia.org/wiki/Theoretical_computer_science), [Artificial Intelligence](https://en.wikipedia.org/wiki/Artificial_intelligence), and [Computer Systems](https://en.wikipedia.org/wiki/Computer). Each of these categories ha... |
Let $L$ be the language over the alphabet $\{a,b\}$ defined by $L = \{w: \mbox{an $a$ in $w$ is always followed by a $b$}\}$. Let $L' = \{w: \mbox{an $a$ in $w$ is never followed by a $b$}\}$. Observe that $L$ and $L'$ are not complements of each other. Strings such as $aab$ and $aba$ belong to neither $L$ nor $L'$ be... |
null |
The language $L_1 = \{a^n b^m: n, m \ge 0, m \ge n\}$ is not regular. This can be proved using the pumping lemma.
By way of contradiction, suppose $L$ is regular. Then, there exists an integer $p$ such that if $s \in L_1$ and $|s| \ge p$, then $s$ can be divided into three pieces as $s=xyz$ such that (1) $xy^iz ... |
One approach is to compute the Voronoi diagram of these line segments. Here are two papers that consider this problem:
[A robust and efficient implementation for the segment Voronoi diagram](http://www.tem.uoc.gr/%7Emkaravel/files/papers/svd-impl.pdf). Menelaos I. Karavelas. International symposium on Voronoi di... |
This is a problem that I have found from *Introduction to automata theory, languages and computation* by John Hopcroft and Jeffrey Ullman.
PDA P=({q0, q1, q2, q3, f)}, {a, b}, {Z0, A, B}, δ, q0, Z, {f}) has the
following rules defining δ:
δ(q0,a,Z)=(q1,AAZ)
δ(q0,b,Z)=(q2,BZ)
δ(q0,... |
I think you can still use the linear time selection algorithm (median of medians) here. Let's call this algorithm $Select$ and let the median position be $m$, which is initially equal to $n/2$.Recall that the algorithm has 3 phases:
1. Group by 5 and select median of each group
2. Choose partition element $p$, by a... |
When an NFA reaches a new state, it splits into multiple copies, with one copy at this new state and other copies at states that can be reached from this new state by following one or more $\epsilon$-transitions. Because these new states are reached without consuming input, you can assume an empty string has been inse... |
When an NFA reaches a new state, it splits into multiple copies, with one copy at this new state and other copies at states that can be reached from this new state by following one or more $\epsilon$-transitions. Because these new states are reached without consuming input, you can assume an empty string has been inse... |
I have forgotten the quantifier:
~$\forall x \,(P(x))\neq$$\forall x \,($~$P(x)).$ Instead
1. ~($\forall x \,,P(x))= $$(\exists x \,,$~$P(x))$.
2. ($\forall x \,,$~$P(x))= $~$(\exists x \,,P(x))$.
That means Complement of $a$ always followed by $b$ is not $a$ never followed by $b$ instead:
1. ... |
There's a difference between how an NFA is represented and how it computes. Three common representations of an NFA are its state transition diagram, the tabular representation, and a description of each component of the 5-tuple by just writing down various sets and formulas. These are equivalent representations - if ... |
I am having a hard time to prove it, what i know is we cannot prove that a language is regular by using pumping lemma cause even if the "pumped string" is in the language the language could still be regular.
But since we already know that ww^r is a context free language cause we can design a pda for it, we should be... |
How to prove ww^r is context free using pumping lemma for context free languages |
|context-free|pushdown-automata|pumping-lemma|context-sensitive|theory| |
null |
null |
Let $C \ge 1$ be the capacity of the knapsack and let $G_1, \dots,G_k$ be your groups, where each group is a non-empty collection of items, i.e., $G_i = \{ x^{(i)}_1, x^{(i)}_2, \dots \}$. Groups are pairwise disjoint. Define $n= \sum_{i=1}^k |G_i|$ as the total number of items in the instance.
For any item $x$, let... |
the expression "graphs" in the title refers to graphs as they are thought in computer science:
Let G = (V(G), E(G)) be a graph. It is a tuple with a set of vertices and edges. |
What LaTeX library do you use for adding graphs to your papers? |
|graphs| |
The pumping lemma for context-free languages is used to prove that a given language is *not* a context-free language. There exists a PDA accepting the language $L = \{w w^r: w \in \{0,1\}\}$, and so $L$ is a context-free language.
The pumping lemma states that all regular languages and all CFL's satisfy a certain... |
According to [this][1] Python does a rehashing when the load factor reaches $2/3$.
[1]: https://mail.python.org/pipermail/python-list/2000-March/048085.html |
I think the easiest is to put the segments into an index (quadtree, R-Tree, BVH, ...), they will typically be represented by their bounding box. Then you can use nearest neighbor search with a custom distance function that calculates the distance to the actual segment represented by the bounding box.
Depending on how ... |
Assume a **bloom filter** that is composed of $H = \{H_1, ..., H_k\}$ hash functions, and uniformly maps elements from an input set $X$ to an array $A$ of size $n$. Let $X_1, X_2$ be two input sets of size $m$. After applying the same bloom filter to both input sets, we receive the arrays $A_1$ and $A_2$ (both of size ... |
Bloom filter creating different arrays from two input sets |
|probability-theory|randomized-algorithms|bloom-filters| |
Let's say there is an unfair coin with $P[head]=p$. We do not now $p$ but we know that $p \geq a$ for a known $a$. After $n$ trials we get $bn$ heads. Now, we want to estimate $p$ so that
- $P[|p-b|\geq gp] \leq \epsilon$, where $g, \epsilon$ are known
Here is what I have got so far:
- We know that $\mu = np$
- *... |
Probability Estimation with Chernoff Bound |
|probability-theory|chernoff-bounds| |
I have the following problem:
> Let Alice and Bob be two people playing games.
>
> Alice and only Alice owns a special device, Robo, that is capable of generating ***one*** truly random number $k \in \mathbb{N}$ per ***game***, within any range given by Alice at some moment of the game.
> The game Alice and Bob... |
Worst case lower bound of the geneal number guessing problem |
|complexity-theory|time-complexity|algorithm-analysis|asymptotics|runtime-analysis| |
I have the following problem:
> Let Alice and Bob be two people playing games.
>
> Alice and only Alice owns a special device, Robo, that is capable of generating ***one*** truly random number $k \in \mathbb{N}$ per ***game***, within any range given by Alice at some moment of the game.
> The game Alice and Bob... |
null |
```
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | eps two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
```
The rules for S, T and U produce $A^i B^j c^k$ with $i+j=2k$. The rules for A and B turn them into... |
I would like to show a language is in not recursive (not in the family $R$) without using a reduction from a language that is known to be non-recursive. In other words, its as if I am discovering the first non-recursive language.
I have 2 languages I would like to show it for. These are:
1. $L_{AC}$ - the pairs... |
How to show a language is not recursive, without using reductions? |
|complexity-theory|formal-languages|automata|undecidability|recursively-enumerable| |
Assume a **bloom filter** that is composed of $H = \{H_1, ..., H_k\}$ hash functions, and uniformly maps elements from an input set $X$ to an array $A$ of size $n$. Let $X_1, X_2$ be two input sets of size $m$. After applying the same bloom filter to both input sets, we receive the arrays $A_1$ and $A_2$ (both of size ... |
```
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | eps two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
```
The rules for S, T and U produce $A^i B^j c^k$ with $i+j=2k$. The rules for A and B turn them into... |
The language of this PDA seems to be the set of all strings that have twice as many $b$'s as $a$'s.
If there is a deficit of $a$'s in the prefix seen so far in the sense that the number of $b$'s exceeds twice the number of $a$'s, then the PDA would be operating essentially from state $q_2$, where it would modify t... |
```
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | eps two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
```
The rules for S, T and U produce $A^i B^j c^k$ with $i+j=2k$. The rules for A and B turn them into... |
I think the easiest is to put the segments into an index (quadtree, R-Tree, BVH, ...), they will typically be represented by their bounding box. Then you can use nearest neighbor search with a custom distance function that calculates the distance to the actual segment represented by the bounding box.
Depending on how ... |
```
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | eps two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
```
The rules for S, T and U produce $A^i B^j c^k$ with $i+j=2k$. The rules for A and B turn them into... |
null |
The language of this PDA seems to be the set of all strings that have twice as many $b$'s as $a$'s.
If there is a deficit of $a$'s in the prefix seen so far in the sense that the number of $b$'s exceeds twice the number of $a$'s, then the PDA would be operating essentially from state $q_2$, where it would modify t... |
Worst case lower bound of the general number guessing problem |
A regular language has a finite state machine, and therefore it has a finite state machine with a minimum number of states n. If we examine the first n letters of an input string, there are n+1 states that we encountered after 0, 1, 2, …, n letters. Since there are no n+1 states, there must be a state S that we encount... |
```
Main rules:
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | ε two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
Additional rules:
S -> A | B | AB
```
The main rules for S, T and U produce $A^i B^j ... |
### Grammar
```
Main rules:
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | ε two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
Additional rules:
S -> A | B | AB
```
The main rules for S, T and U pr... |
### Grammar
```
Main rules:
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | ε two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
Additional rules:
S -> A | B | AB
```
The main rules for S, T and U pr... |
It is often stated that in 1949 Shannon proved, using a non-constructive counting argument, that some boolean functions have exponential circuit complexity, see [1] and many texts on computational complexity. This result has been strengthened later, showing that, in the limit, almost all boolean functions have exponent... |
Shannon's result that some Boolean functions require exponential circuits |
|complexity-theory|reference-request|complexity-classes|circuits|boolean-complexity| |
In 1949 Shannon proved, using a non-constructive counting argument, that some boolean functions have exponential circuit complexity, see [1] and many texts on computational complexity. This result has been strengthened later, showing that, in the limit, almost all boolean functions have exponential circuit complexity. ... |
null |
### Grammar
```
Main rules:
S -> AASc | T two A for each c
T -> ABUc | U AB for one c (at most once)
U -> BBUc | ε two B for each c
A -> Aa | a one or more a for each A
B -> Bb | b one or more b for each B
Additional rules:
S -> A | B | AB
```
The main rules for S, T and U pr... |
No, $L_1$ is not necessarily context-free.
------
For example, let $L=\{0^n1^{3n}\mid n\ge0\}$.
If $ uv=0^n1^{3n}$ and $|u|=|v|$, then $u=0^n1^n$ and $v=1^{2n}$. We have $u^Rv^R=1^n0^n1^{2n}$.
So, $L_1=\{1^n0^n1^{2n}\mid n\ge0\}$, which is not context-free.
<!-- Conjecture: If all words in $L$ are of ... |
null |
In 1949 Shannon proved, using a non-constructive counting argument, that some boolean functions have exponential circuit complexity, see [1] and many texts on computational complexity. This result has been strengthened later, showing that, in the limit, almost all boolean functions have exponential circuit complexity. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.