instruction
stringlengths
0
29.8k
⌀
Multiples of three, expressed in binary, especially combined with a proof that powers of three, expressed in binary, is not a regular language. (Or in general: multiples of $n$ expressed in base $b$ are regular, whereas powers of $n$ expressed in base $b$ are a regular language iff there exist positive integral $p$ and...
I have an optimization problem. The problem consists initially of the presence of several trucks, each one having different maximum capacities. There are also multiple customer orders, each with a different weight. The problem is to fill the trucks with orders, but initially prioritizing trucks with greater ...
optimization problem about capacitated vehicle routing problem
|graphs|optimization|program-optimization|combinatory-logic|
null
For a different kind of example, consider the language consisting of the usual decimal representations of integer multiples of 7, namely $\{ \dots, -14, -7, 0, 7, 14, 21, 28, \dots \}$. This is a regular language. (And in fact, the same would be true with any other positive integer instead of 7; but 7 is a cool example...
For a different kind of example, consider the language consisting of the usual decimal representations of integer multiples of 7, namely $\{ \dots, -14, -7, 0, 7, 14, 21, 28, \dots \}$. This is a regular language. (And in fact, the same would be true with any other positive integer instead of 7; but 7 is a cool example...
In standard agnostic learning, we assume that there is a concept class $C\subseteq \{c:\{0,1\}^n\rightarrow \{0,1\}\}$. Given samples from a distribution $D:\{0,1\}^n\rightarrow [0,1]$, the goal is to output the best $h\in C$ for which $err_D(h)\leq C\cdot opt+\varepsilon$, where $opt= \min_{c\in C}err_D(c)$ and $C=1$....
Regarding constant * opt approximation in agnostic learning
|complexity-theory|machine-learning|computation-models|learning-theory|
In standard agnostic learning, we assume that there is a concept class $C\subseteq \{c:\{0,1\}^n\rightarrow \{0,1\}\}$. Given samples from a distribution $D:\{0,1\}^n\times \{0,1\}\rightarrow [0,1]$, the goal is to output the best $h\in C$ for which $err_D(h)\leq C\cdot opt+\varepsilon$, where $opt= \min_{c\in C}err_D(...
In standard agnostic learning, we assume that there is a concept class $C\subseteq \{c:\{0,1\}^n\rightarrow \{0,1\}\}$. Given samples from a distribution $D:\{0,1\}^n\times \{0,1\}\rightarrow [0,1]$, the goal is to output the best $h\in C$ for which $err_D(h)\leq C\cdot opt+\varepsilon$, where $opt= \min_{c\in C}err_D(...
Yes, modern optical fibers are good enough for single-photon communication. This is essential when it comes to quantum cryptography, which works with photon pairs. These quantum systems are inherently digital; the photon polarization encodes a single bit.
You're looking at an ancient CPU. Back then, IC technology greatly limited the number of available transistors on each chip. As it became easier and easier to add transistors, we started seeing big shifts in the use of these transistors. One of the most obvious shifts is the fact that a large number of CPU designs a...
null
So basically my question is if i have for example 2.2 i need to create a python function to round numers to its higher 0.5 part, i mean 2.2 --> 2.5 2.3 --> 2.5 2.5 --> 2.5 2.6 --> 3 I cant use anything but maths operators ( +, *, **, //, %, - )
How to round numbers to its 0.5 superior in python
|logic|
I believe its possible to achieve this with natural numbers. The example below is for 2d to 1d conversions both ways, I do believe this generalizes to n-dimensions. I'm looking to apply this to the Real numbers. I realize the examples below use modulo which is not supported in Real arithmetic. Could this be possibl...
Is there an algorithm which can map back and forth a multi-dimensional real number (R^n) to a single dimensional real (R)?
|algorithms|sets|real-numbers|
The trick is to count in halves instead of units, i.e., double double the original number, round it the next integer, and finally divide back by $2$. Rounding a number $x$ down previous integer using only the listed operators is quite easy: just use the integer division by $1$, i.e., `x//1`. Rounding $x$ to the n...
{"Voters":[{"Id":153041,"DisplayName":"Chettos"}]}
There is one not-so-useful special case: Pairs of bases where each is a power of their GCD. You can just consider symbol groups "the size of their LCM" and use a *lookup table* - recoding more than handling numbers.
null
Given two DFAs, is it also a correct method to start with the combination of the initial states of both automata, then check where I can go for each symbol from these two states. Then add the combination of those states to the new automata and so on. So that I do not have to first take every possible combination of sta...
Optimal way to construct union automata of two DFAs
|formal-languages|regular-languages|automata|finite-automata|
My sister (a high school teacher) came and asked me the following question: > "Hi bro I'm having 28 new students in my class. They need to know each > other. So I want everybody to work together in small groups. I'm > thinking splitting them in groups of 4 and having 9 rounds. Then > everyone meets 3 people in ev...
How to make an algorithm to optimally make student groups without overlap
|algorithms|
Are both regular expressions correct for the following automata? [![enter image description here][1]][1] [![enter image description here][2]][2] The above one is the solution provided by the teacher, the other one is my solution that I found by the algorithm where we use a generalized tranisition graph and r...
Correct regular expression of the given automata
|regular-languages|automata|finite-automata|regular-expressions|
null
{"Voters":[{"Id":6759,"DisplayName":"Steven"},{"Id":755,"DisplayName":"D.W."}]}
I can't seem to get a straight answer as to what a cpu clock is. I know there are quartz crystal clocks that work by the bending of quartz that happens as an electrical current is passed through it, do modern cpus also use a crystal with the same property?
What is a cpu clock physically?
|cpu|clocks|
null
That's basically the idea: 1. Construct an NFA with new start state, which has ε transitions to each start state of the DFAs. 2. Use the [subset construction](https://en.wikipedia.org/wiki/Powerset_construction) to create a new DFA from the NFA.
You could get many examples from languages that are finite but don't look it. For example, the language of strings all of whose prefixes are decimal representations of prime numbers is regular because there are only 83 such strings ([A024770](https://oeis.org/A024770)). The language of sequences of `0`s that appear ...
Multiples of three, expressed in binary, especially combined with a proof that powers of three, expressed in binary, is not a regular language. (Or in general: multiples of $n$ expressed in base $b$ are regular, whereas powers of $n$ expressed in base $b$ are a regular language iff there exist positive integral $p$ and...
I believe its possible to achieve this with natural numbers. The example below is for 2d to 1d conversions both ways, I do believe this generalizes to n-dimensions. I'm looking to apply this to the Real numbers. I realize the examples below use modulo which is not supported in Real arithmetic. Could this be possibl...
I believe its possible to achieve this with natural numbers. The example below is for 2d to 1d conversions both ways, I do believe this generalizes to n-dimensions. The mapping should work in a way that means that the total order of the elements on each side of the mapping is consistent, ie. moving through one spac...
Is there an order preserving algorithm which can map back and forth a multi-dimensional real number (R^n) to a single dimensional real (R)?
Modern CPUs are originally generated by quartz crystal oscillators of about 20MHz or so, and then the frequency is multiplied by one or more [phase-locked loops](https://en.wikipedia.org/wiki/Phase-locked_loop) to generate the clock signals for different parts of the system. (such as 4GHz for a CPU core). This is mo...
There are general algorithms to determine whether two regular expressions represent the same language. A classic approach is described [here](https://cs.stackexchange.com/questions/52853/proving-following-regular-expressions-equal-to-one-another). ------ The expression given by your teacher, $E=(\lambda+ a a^*b(a...
|algorithms|combinatorics|combinatorial-design|
Given $n$ persons, this question is about a sequence of unordered pair of persons, called a two-person schedule(TPS). A TPS is good if any of its initial contiguous subsequences satisfies the following two conditions. > (**fairness requirement**) Any person cannot appear two times more than any other person. > > (...
I'm assuming we're talking about classical first-order logic here. Consider two sets of formulas $\Gamma$ and $\Lambda$. If $\Gamma$ and $\Lambda$ are equisatisfiable, it means that $\Gamma$ has a model iff $\Lambda$ has a model. They don't even have to be the same model! So it's a pretty weak condition. And it's wh...
I'm trying to find examples of languages that don't seem regular, but are. A reference to where such examples may be found is also appreciated. So far I've found two. One is $L_1=\{a^ku\,\,|\,\,u\in \{a,b\}^∗$ and $u$ contains at least $k$ $a$'s, for $k\geq 1\}$, from [this post](https://cs.stackexchange.com/questio...
null
Integer decomposition algorithm
null
Yes, this works, as long as you do it right. If you do it right, you only explore the reachable states of the product automaton. Since the other states aren't reachable, it doesn't matter whether you include them in the resulting automaton or not.
That's basically the idea. It's effectively equivalent to the standard algorithm: 1. Construct an NFA with all the states and transitions of the DFAs being combined, plus a new state $q_0$ with has ε transitions to each start state of the DFAs. The set of final states of the NFA is the union of the final states of t...
null
You can solve it with satisfiability. Here i have created the SAT formula for you. [![enter image description here][1]][1] Edit: i just realized that the formula is a Horn formula, and so it can be solved in polynomial time [1]: https://i.stack.imgur.com/6Z8cP.jpg
{"Voters":[{"Id":148735,"DisplayName":"LLL"}]}
You can solve it with satisfiability. Here i have created the SAT formula for you. Sorry i deleted this answer earlier because i forgot to add a formula, i fixed it, it should be correct now. [![enter image description here][1]][1] [![enter image description here][2]][2] [1]: https://i.stack.imgur.com/zVkBj....
{"Voters":[{"Id":148735,"DisplayName":"LLL"}]}
You can solve it with satisfiability. Here i have created the SAT formula for you. Sorry i deleted this answer earlier because i forgot to add a formula, i fixed it, it should be correct now. [![enter image description here][1]][1] [![enter image description here][2]][2] [1]: https://i.stack.imgur.com/4rpEa....
You can solve it with satisfiability. Here i have created the SAT formula for you. Sorry i deleted this answer earlier because i forgot to add a formula, i fixed it, it should be correct now. [![enter image description here][1]][1] [![enter image description here][2]][2] [1]: https://i.stack.imgur.com/GVXMJ....
Exercise 3.4.9 of _The Dragon Book_ defines _Fibonacci strings_ as follows: > 1. $s_1 = b$. > 2. $s_2 = a$. > 3. $s_k = s_{k-1}s_{k-2}$ for $k>2$. Part (d) then poses the following question: > Show that the failure function of $s_n$ can be expressed by $f(1) = f(2) = 0$, and for $2 < j \le |s_n|$, $f(j)$ is ...
Failure function of the Fibonacci strings (The Dragon Book Exercise 3.4.9d)
|compilers|
Exercise 3.4.9 of _The Dragon Book_ defines _Fibonacci strings_ as follows: > 1. $s_1 = b$. > 2. $s_2 = a$. > 3. $s_k = s_{k-1}s_{k-2}$ for $k>2$. Part (d) then poses the following question: > Show that the failure function of $s_n$ can be expressed by $f(1) = f(2) = 0$, and for $2 < j \le |s_n|$, $f(j)$ is ...
Exercise 3.4.9 of _The Dragon Book_ defines _Fibonacci strings_ as follows: > 1. $s_1 = b$. > 2. $s_2 = a$. > 3. $s_k = s_{k-1}s_{k-2}$ for $k>2$. Part (d) then poses the following question: > Show that the failure function of $s_n$ can be expressed by $f(1) = f(2) = 0$, and for $2 < j \le |s_n|$, $f(j)$ is ...
Modern clocks are originally generated by quartz crystal oscillators of about 20MHz or so, and then the frequency is multiplied by one or more [phase-locked loops](https://en.wikipedia.org/wiki/Phase-locked_loop) to generate the clock signals for different parts of the system. (such as 4GHz for a CPU core). This is ...
Exercise 3.4.9 of _The Dragon Book_ defines _Fibonacci strings_ as follows: > 1. $s_1 = b$. > 2. $s_2 = a$. > 3. $s_k = s_{k-1}s_{k-2}$ for $k>2$. Part (d) then poses the following question: > Show that the failure function of $s_n$ can be expressed by $f(1) = f(2) = 0$, and for $2 < j \le |s_n|$, $f(j)$ is ...
I need to give an example of a language $B$ is $NL-complete$ where $B^* \in L$. I know $PATH$ is $NL-complete$ (but not limited to using other languages). I am clueless about that. I know $L$ is not closed under $^*$ so there must a language like that. Any help would be appreciated.
Give an example of a language $B$ is $NL-complete$ where $B^* \in L$
|complexity-theory|
|complexity-theory|graphs|
null
null
Let $\Sigma=\{0,1\}$. Take any NL-complete language $C \subset \Sigma^*$ and consider $B = C \cup \{0,1\}$. Clearly $B$ is still NL-complete (since $|B \, \Delta \, C| \le 2)$ and you have $B^* \supseteq \{0,1\}^* = \Sigma^*$, i.e., $B^* = \Sigma^* \in L$.
There are general algorithms to determine whether two regular expressions represent the same language. A classic approach is described [here](https://cs.stackexchange.com/questions/52853/proving-following-regular-expressions-equal-to-one-another). ------ The expression given by your teacher, $E=(\lambda+ a a^*b(a...
Are both regular expressions correct for the following automaton? [![enter image description here][1]][1] $$(\lambda+ a a^*b(ab)^*)(\lambda + b(a+b)^*)\\ \ \\ (a a^*b)^*(\lambda + b(a+b)^*)$$ The first one is the solution provided by the teacher. The second one is my solution that I found by the algorithm wh...
Are both regular expressions correct for the given DFA with three states?
On [the website for the book *Modern Compiler Design*][1], it is claimed that: > [The book] recognizes lexical analysis, LR parsing and BURS code generation as > instances of bottom-up pattern matching and explains them uniformly > using dotted items, thus unifying three important techniques in > compiler design,...
What is bottom-up pattern matching?
|parsers|
Below is the language, determine (R), (RE), (coRE). and prove your answer. $L=\{<M_1>,<M_2>|M_1,M_2$ are Turing-machines and $L(M_1)\cap L(M_2)\neq \phi \}$ **Attempt:** I Think the language $L\in RE$ Because we need to use $U-MT$ such that we check all the $L(M_1)\cap L(M_2)\neq \phi$ to see if all language in ...
$L=\{<M_1>,<M_2>|M_1,M_2$ are Turing-machines and $L(M_1)\cap L(M_2)\neq \phi \}$
|formal-languages|turing-machines|computability|
You are right, the author of the game did not provide any hint to why IcoSoKu always has a solution. The [latest product page][1] is quite cheeky: > With the perfect geometry of an icosahedron, Icosoku can be solved every single try! I don't know any mathematical proof, but Prof. Agostino Dovier and I solved the ...
First, $L$ is not recursive: there is an easy reduction from $L_{ne}=\{\langle M\rangle \mid \mathcal{L}(M) \neq \emptyset\}$ which is a well known non-recursive language (for the reduction, just use a MT $M_2$ such that $\mathcal{L}(M_2) = \Sigma^*$). Now, $L$ is indeed recursively enumerable. The intuition behind ...
You are right, the author of the game did not provide any hint to why IcoSoKu always has a solution. The [latest product page][1] is quite cheeky: > With the perfect geometry of an icosahedron, Icosoku can be solved every single try! I don't know any mathematical proof, but Prof. Agostino Dovier and I solved the ...
A CPU clock is a signal which is used for two related purposes: 1. Devices that are synchronous to a common clock agree that they will only look at signals from other such devices within a very short window after the clock changes. 2. Devices which are synchronous to a common clock agree that within that window t...
Matching is the same activity for regular expressions (and variants of them) as parsing is for grammars. Top-down matching/parsing tries to expand parse trees for the input from the root downwards. Standard examples in compiler construction courses are *recursive descent* and *LL(k) parsing*. With top-down parsin...
First, $L$ is not recursive: there is an easy reduction from $L_{ne}=\{\langle M\rangle \mid \mathcal{L}(M) \neq \emptyset\}$ which is a well known non-recursive language (for the reduction, just use a TM $M_2$ such that $\mathcal{L}(M_2) = \Sigma^*$). Now, $L$ is indeed recursively enumerable. The intuition behind ...
I believe its possible to achieve this with natural numbers. The example below is for 2d to 1d conversions both ways, I do believe this generalizes to n-dimensions. The mapping should work in a way that means that there is a total order of the elements on each side of the mapping, ie. moving through one space in or...
Is there an algorithm which can map back and forth a multi-dimensional real number (R^n) to a single dimensional real (R)?
This is a picture of a DIY quartz clock: [![quartz clock][1]][1] This is (part of) a picture of a mainboard: [![mainboard][2]][2] Note the component I have marked with an arrow. You can see they look identical. Some caveats: * Quartz crystals come in different packages, I have chosen two examples that h...
Are there any (deterministic or randomized) algorithms that run in time $\operatorname{poly}(n)\log^p{n}$ for $p < 0$? What are some examples?
What are some algorithms with runtimes that involve a \log{n} term with a negative exponent?
|algorithms|complexity-theory|time-complexity|
null