instruction
stringlengths
0
29.8k
⌀
Easy to state open problems in computability theory
|computability|
**Claim**: No, there is no such $\mu$. **Proof**: We give an infinite sequence of AVL trees of growing size whose weight-balance value tends to $0$, contradicting the claim. Let $C_h$ the complete tree of height $h$; it has $2^{h+1}-1$ nodes. Let $S_h$ the *Fibonacci tree* of height $h$; it has $F_{h+2} - 1$ n...
I was searching for interesting and easy to state open problems in computability (understandable by undergraduate students taking their first course in computability) to give examples of open problems (and obviously I want the students to be able to understand the problem without needing too much new definitions and al...
Consider the following protocol, meant to authenticate $A$ (Alice) to $B$ (Bob) and vice versa. $$ \begin{align*} A \to B: &\quad \text{“I'm Alice”}, R_A \\ B \to A: &\quad E(R_A, K) \\ A \to B: &\quad E(\langle R_A+1, P_A\rangle, K) \\ \end{align*} $$ * $R$ is a random nonce. * $K$ is a pre-shared symm...
Break an authentication protocol based on a pre-shared symmetric key
|security|protocols|
|cryptography|security|protocols|
## Ogden's Lemma ## > **Lemma (Ogden).** Let $L$ be a context-free language. Then there is a constant $N$ such that for every $z\in L$ and any way of *marking* $N$ or more positions (symbols) of $z$ as "distinguished positions", then $z$ can be written as $z=uvwxy$, such that > > 1. $vx$ has at least one distinguis...
One famous open question about the poset $(D, \leq_T)$ of Turing degrees is whether it has any non-trivial automorphisms. That is, does there exist a non-identity bijection $f\colon D \to D$ such that $a \leq_T b $ if and only if $f(a) \leq_T f(b)$?.
It seems that for this model, non-deterministic machines are not equivalent to deterministic ones, for basically the same reason that deterministic PDAs are not equivalent to non-deterministic ones. Consider the language $$L =\\{ x\$y \mid |x|=|y| \wedge x\ne y\\}$$ (where $\$$ is a special sign not contained in $...
In one of the programming tutorial at my university, we asked students to compare the performance of quicksort, mergesort, insertion sort vs. Python's built-in list.sort (called [Timsort][1]). The experimental results surprised me deeply since the built-in list.sort performed so much better than other sorting algorithm...
In one of the programming tutorial at my university, we asked students to compare the performance of quicksort, mergesort, insertion sort vs. Python's built-in list.sort (called [Timsort][1]). The experimental results surprised me deeply since the built-in list.sort performed so much better than other sorting algorithm...
Rewriting system is a set of rules in the form of $A \leftrightarrow B$. If we apply that rule to a string $w$ we replace any substring $A$ in $w$ with a substring $B$ and vice versa. Given a starting string $AAABB$ can we derive $BAAB$ in the system with the following rules: - $A \leftrightarrow BA$ - $BAB...
Is it possible to derive a string in this rewriting system?
|computability|
Notice that the parity of the number of $A$s does not change.
Notice that the parity of the number of $A$s does not change. Since one string contains an odd number $A$ and the other even, they are not reachable. I believe in general, this is likely to be an undecideable problem. If the transforms are one way(i.e rules of the form $A \to BA$) it is so , for eg see: [Tag System]...
Notice that the parity of the number of $A$s does not change. Since one string contains an odd number $A$ and the other even, they are not reachable. I believe in general (for an arbitrary set of rules, not your specific example), this is likely to be an undecidable problem. If the transforms are one way(i.e rules o...
It seems that for this model, non-deterministic machines are not equivalent to deterministic ones, for basically the same reason that deterministic PDAs are not equivalent to non-deterministic ones. Consider the language $$L =\\{ x\$y \mid |x|=|y| \wedge x\ne y\\}$$ (where $\$$ is a special sign not contained in $...
|computability|rewriting|
Access control models are typically very course-grained, allowing one access to a resource (possibly with some combination of read/write/execute permission) or exclude such access. Some models of database security allow access to be done on a per row basis (though I don't have a reference handy). > Have fine grained...
Fine-grained security models for XML data
|untagged|
**Claim:** $\mathrm{HAL}$ (the class of languages accepted by min-heap automata) and $\mathrm{CFL}$ are incomparable. ###$\mathrm{HAL} \setminus \mathrm{CFL} \neq \emptyset$### *This part of the answer relates to both types.* A min-heap automaton (HA) with finite, totally ordered heap alphabet accepts $L = \{ a^...
*See the end of this post for some clarification on the definition(s) of min-heap automata.* One can imagine using a variety of data structures for storing information for use by state machines. For instance, push-down automata store information in a stack, and Turing machines use a tape. State machines using queues...
**Claim:** $\mathrm{HAL}$ (the class of languages accepted by min-heap automata) and $\mathrm{CFL}$ are incomparable. ###$\mathrm{HAL} \setminus \mathrm{CFL} \neq \emptyset$### *This part of the answer relates to both types.* A min-heap automaton (HA) with finite, totally ordered heap alphabet accepts $L = \{ a^...
|computability|term-rewriting|
Access control models are typically very coarse-grained, allowing one access to a resource (possibly with some combination of read/write/execute permission) or exclude such access. Some models of database security allow access to be granted on a per row basis (though I don't have a reference handy). Have fine-graine...
|access-control|structured-data|
*I'm no expert on access control for structured data. This is a 10000-foot view. Don't assume a correlation between what my answer covers, what is scientifically interesting and what is significant in terms of deployment.* Take any access control or permission mechanism and slap some angle braces around it, and you ...
###Closure Properties### Once you have small collection of non-context-free languages you can often use [closure properties](https://en.wikipedia.org/wiki/Context-free_language#Closure_properties) of $\mathrm{CFL}$: > Assume $L \in \mathrm{CFL}$. Then, by closure property X (together with Y), $L' \in \mathrm{CFL}$...
###Closure Properties### Once you have a small collection of non-context-free languages you can often use [closure properties](https://en.wikipedia.org/wiki/Context-free_language#Closure_properties) of $\mathrm{CFL}$ like this: > Assume $L \in \mathrm{CFL}$. Then, by closure property X (together with Y), $L' \in \...
Here is what we (believe to) know: * $\mathrm{HAL} \setminus \mathrm{CFL} \neq \emptyset$ (type-1, type-2) * $\mathrm{CFL} \setminus \mathrm{HAL} \neq \emptyset$ (type-1) * $\mathrm{CFL} \subseteq \mathrm{HAL}$ (type-2, by definition) * $\mathrm{CSL} \setminus \mathrm{HAL} \neq \emptyset$ (type-1, type-2) ...
**Claim**: $\mathrm{HAL}$ is *not* closed against complement. **Proof Idea**: We have [agreed](http://cs.stackexchange.com/a/114/98) that $\mathrm{EPAL}$ (the language of even palindromes over a non-unary alphabet) is not in $\mathrm{HAL}$. We show that $\overline{\mathrm{EPAL}} \in \mathrm{HAL}$. *This works for...
*This is a follow-up question of [this one](http://cs.stackexchange.com/q/110/98)*. In a previous question about [exotic state machines][1], Alex ten Brink and Raphael addressed the computational capabilities of a peculiar kind of state machine: min-heap automata. They were able to show that the set of languages acc...
*This is a follow-up question of [this one](http://cs.stackexchange.com/q/110/98).* In a previous question about [exotic state machines][1], Alex ten Brink and Raphael addressed the computational capabilities of a peculiar kind of state machine: min-heap automata. They were able to show that the set of languages acc...
*This is a follow-up question of [this one](http://cs.stackexchange.com/q/110/98).* In a previous question about [exotic state machines][1], Alex ten Brink and Raphael addressed the computational capabilities of a peculiar kind of state machine: min-heap automata. They were able to show that the set of languages acc...
*See the end of this post for some clarification on the definition(s) of min-heap automata.* One can imagine using a variety of data structures for storing information for use by state machines. For instance, push-down automata store information in a stack, and Turing machines use a tape. State machines using queues...
I've heard the motto **interaction is more powerful than algorithms** from Peter Wegner. The basis of the idea is that a Turing Machine cannot handle interaction with the environment. > How can this be so? How can something be more powerful than a Turing Machine? What is the essence of this story? Why is it not mor...
Is interaction more powerful than algorithms?
|computability|
We know post-order, post L(x) => [x] post N(x,l,r) => (post l) ++ (post r) ++ [x] and pre-order pre L(x) => [x] pre N(x,l,r) => [x] ++ (pre l) ++ (pre r) and in-order traversal resp. sequentialisation. in L(x) => [x] in N(x,l,r) => (in l) ++ [x] ++ (in r) One can...
Which combinations of pre-, post- and in-order sequentialisation are unique?
|algorithms|binary-trees|
**Claim**: No, there is no such $\mu$. **Proof**: We give an infinite sequence of AVL trees of growing size whose weight-balance value tends to $0$, contradicting the claim. Let $C_h$ the complete tree of height $h$; it has $2^{h+1}-1$ nodes. Let $S_h$ the *Fibonacci tree* of height $h$; it has $F_{h+2} - 1$ n...
What you are doing is a very convenient abuse of notation. Some pedants will say that what you write is nonsense, as $\mathcal{O}(f)$ denotes a _set_ and you cannot do arithmetic operations on them the way you are doing. But it is a good idea to ignore those pedants and assume that $\mathcal{O}(f)$ stands for _so...
Recently ACM held Ubiquity symposium 'What is Computation?' in which Peter Wegner published an article which reflects his views on Interactive computing. Here two excerpts from the article by Peter Wegner: >One new concept, missing from early Turing machines, is "Interactive Computing," which accommodates intera...
Recently ACM held Ubiquity symposium '[What is Computation?][1]' in which Peter Wegner published an article which reflects his views on Interactive computing. Here two excerpts from the article by Peter Wegner: >One new concept, missing from early Turing machines, is "Interactive Computing," which accommodates i...
Recently ACM held Ubiquity symposium '[What is Computation?][1]' in which Peter Wegner published an article which reflects his views on Interactive computing. Here two excerpts from the article by Peter Wegner: >One new concept, missing from early Turing machines, is "Interactive Computing," which accommodates i...
Recently ACM held Ubiquity symposium '[What is Computation?][1]' in which Peter Wegner published an article which reflects his views on Interactive computing. Here are two excerpts from the article by Peter Wegner: >One new concept, missing from early Turing machines, is "Interactive Computing," which accommodat...
First, I'll assume that all elements are distinct. No amount of sequentialisations is going to tell you the shape of a tree with elements `[3,3,3,3,3]`. It is possible to reconstruct some trees with duplicate elements, of course; I don't know what nice sufficient conditions exist. Continuing on the negative results,...
First, I'll assume that all elements are distinct. No amount of sequentialisations is going to tell you the shape of a tree with elements `[3,3,3,3,3]`. It is possible to reconstruct some trees with duplicate elements, of course; I don't know what nice sufficient conditions exist. Continuing on the negative results,...
The closest I can think of is the [MetaKlaim][1] language. [Klaim][2] is a process calculus with asynchronous communication via [tuple spaces][3]. MetaKlaim is an extension of Klaim that integrates the meta-programming features of [MetaML][4], namely [multi-stage programming with types][7]. (You may be more familiar wi...
We're in a shared memory concurrency model where all reads and writes to integer variables are atomic. * `do:` $S_1$ `in parallel with:` $S_2$   means to execute $S_1$ and $S_2$ in separate threads, concurrently. * `atomically:` $S$   means to execute $S$ atomically, i.e. all other threads are stopped during ...
termination of two concurrent threads with shared variables
|concurrency|
In a previous [question][1] there was a definition of weight balanced trees and a question regarding red-black trees. This question is to ask the same question, but for [AVL trees][2]. The question is, given the definition of $\mu$-balanced trees as in the other question, > Is there some $\mu \gt 0$ such tha...
You are given an array of $2n$ elements $$a_1, a_2, \dots, a_n, b_1, b_2, \dots b_n$$ The task is to interleave the array, using an in-place algorithm such that the resulting array looks like $$b_1, a_1, b_2, a_2, \dots , b_n, a_n$$ If the in-place requirement wasn't there, we could easily create a new a...
I've heard the motto [**interaction is more powerful than algorithms**][1] from [Peter Wegner][2]. The basis of the idea is that a Turing Machine cannot handle interaction, that is, communication (input/output) with the outside world/environment. > How can this be so? How can something be more powerful than a Turing...
We're in a shared memory concurrency model where all reads and writes to integer variables are atomic. * `do:` $S_1$ `in parallel with:` $S_2$   means to execute $S_1$ and $S_2$ in separate threads, concurrently. * `atomically(`$E$`)`   means to evaluate $E$ atomically, i.e. all other threads are stopped during...
Recently ACM held Ubiquity symposium '[What is Computation?][1]' in which Peter Wegner published an article which reflects his views on Interactive computing. Here are two excerpts from the article by Peter Wegner: >One new concept, missing from early Turing machines, is "Interactive Computing," which accommodat...
A drink dispenser requires the user to insert a coin ($\bar c$), then press one of three buttons: $\bar d_{\text{tea}}$ requests a cup of tea $e_{\text{tea}}$, ditto for coffee, and $\bar r$ requests a refund. This dispenser can be modeled by the following CCS process: $$ M \stackrel{\mathrm{def}}= c.(d_{\text{tea}}...
CCS process for a drink dispenser with two different prices
|concurrency|
|concurrency|shared-memory|imperative-programming|
The most common complexity class associated to counting problems is [#P][1]. Deciding if there a simple path from a given node to another is clearly in NP. Counting them is then in #P. About the NP-completeness: even if that's not a decision problem, it would hardly fit in NP: there may be $n!$ paths, and non-determ...
If you implement the refund like this: $$ M \stackrel{\mathrm{def}} = c.( d_{\text{tea}}.\bar e_{\text{tea}}.M + d_{\text{coffee}}.\bar e_{\text{coffee}}.M + r.\bar c.M ) $$ then you can easily profit from warfare that way: $$ M \stackrel{\mathrm{def}} = c.( d_{\text{tea}}.\bar ...
This $M_0$ machine is more convenient: $$ M_0 := c.M_1 $$ $$ M_1 := d_{\text{tea}}.\bar e_{\text{tea}}.M_1 + c. M_2 + r.\bar c.M_0 + c.M_2$$ $$ M_{n} := d_{\text{tea}}.\bar e_{\text{tea}}.M_{n-1} + d_{\text{coffee}}.\bar e_{\text{coffee}}.M_{n-2} + r.\underbrace{\bar c.\dots\bar c.}_{n}M_0 + c.M_{n+1}$$ (Bu...
This trace is possible, in two separate threads T1 and T2. $state$ is $(x,y)$. - T1: `...` $state=(0, 4)$ - T1: `x = x + 1; y = y - 1` $~~state=(1, 3)$ - T1: `x = x + 1; y = y - 1` $~~state=(2, 2)$ - T2: `x == y` evaluates to true, `pass` and then `x = 0;` $~~state=(0, 2)$ - T1: `x != y` evaluates to true, ...
A drink dispenser requires the user to insert a coin ($\bar c$), then press one of three buttons: $\bar d_{\text{tea}}$ requests a cup of tea $e_{\text{tea}}$, ditto for coffee, and $\bar r$ requests a refund (i.e. the machine gives back the coin: $\bar b$). This dispenser can be modeled by the following CCS process: ...
This $M_0$ machine is more convenient than the one you propose: $$ M_0 := c.M_1 $$ $$ M_1 := d_{\text{tea}}.\bar e_{\text{tea}}.M_1 + r.\bar b.M_0 + c.M_2$$ $$ M_{n} := d_{\text{tea}}.\bar e_{\text{tea}}.M_{n-1} + d_{\text{coffee}}.\bar e_{\text{coffee}}.M_{n-2} + r.\underbrace{\bar b.\dots\bar b.}_{n}M_0 + c....
I will note $\bar b$ (back) to mean that the machine refunds one coin: $$ M \stackrel{\mathrm{def}} = c.( d_{\text{tea}}.\bar e_{\text{tea}}.M + d_{\text{coffee}}.\bar e_{\text{coffee}}.M + r.\bar b.M ) $$ then you can easily profit from warfare that way: $$ M \stackrel{\mathrm{def}} = ...
I will note $\bar b$ (back) to mean that the machine refunds one coin: $$ M \stackrel{\mathrm{def}} = c.( d_{\text{tea}}.\bar e_{\text{tea}}.M + d_{\text{coffee}}.\bar e_{\text{coffee}}.M + r.\bar b.M ) $$ then you can easily profit from warfare that way: $$ M \stackrel{\mathrm{def}} = ...
You can easily profit from warfare that way: $$ M \stackrel{\mathrm{def}} = c.( d_{\text{tea}}.\bar e_{\text{tea}}.M + r.\bar b.M + c.( d_{\text{coffee}}.\bar e_{\text{coffee}}.M + r.\bar b.\bar b.M ) ) $$ note that you have to press refund to get a tea if you put too many...
It's insecure precisely due to the reason you mention - there is some information leakage. Basically, if you have any assumptions about plaintexts (english text, files with known structure, etc), it leads to an easy statistical analysis. Probably using it **twice** doesn't change the practicality of the attack signi...
This trace is possible, in two separate threads T1 and T2. $state$ is $(x,y)$. - T1: `...` $state=(0, 4)$ - T1: `x = x + 1; y = y - 1` $~~state=(1, 3)$ - T1: `x = x + 1; y = y - 1` $~~state=(2, 2)$ - T2: `x == y` evaluates to true, `pass` and then `x = 0;` $~~state=(0, 2)$ - T1: `x != y` evaluates to true, ...
Suppose you use a one-time pad with English text, and you use it twice. Now, you can get $(m_1 \oplus k) \oplus (m_2 \oplus k) = m_1 \oplus m_2$. English text has an entropy of something like 1.3 bits per letter. The XOR of two messages has 2.6 bits per letter. There are 26 letters in the alphabet, so this gives ...
Intro graphics courses usually have a project that asks you to build a ray tracer to render a scene. Many graphics students entering grad school say that they want to work on ray tracing. And yet it seems that ray tracing is a dead field in venues like SIGGRAPH etc. Is ray tracing really the *best* way to render a ...
Ray Tracing versus pixel-based rendering ?
|graphics|
I'm pretty fluent in C/C++, and can make my way around the various scripting languages (awk/sed/perl). I've started using python a lot more because it combines some of the nifty aspects of C++ with the scripting capabilities of awk/sed/perl. But why are there so many different programming languages ? I'm guessing al...
Why are there so many programming languages ?
|programming-languages|
Functional programming languages are usually based on the different (but equivalent in power) model of computation: [lambda-calculus][1]. There are some untyped (has Python-like typing) languages such as LISP, Scheme (used in widely recognizable [Structure and Interpretation of Computer Programs][2] book/course) and st...
If you have to recommend books for someone who wants to learn more about TCS at the introductory level such as automata theory, algorithmics, complexity theory, etc, what book(s) would you recommend for those who are interested and want to learn more about TCS, but not had any exposure to it?
List of intro TCS books for those who don't know much about TCS
|soft-question|
Fully connected (at least layer to layer with more than 2 hidden layers) backprop networks are universal learners. Unfortunately, they are often slow to learn and tend to over-fit or have awkward generalizations. From fooling around with these networks, I have observed that prunning some of the edges (so that their...
Why do neural networks seem to perform better with restrictions placed on their topology?
|machine-learning|network-topology|neural-networks|
If you would like to have a general introduction without getting to deep into the technical details, I suggest David Harel's [Algorithmics: The Spirit of Computing][1]. After that, this is my favorite list: - Michael Sipser's [Introduction to the Theory of Computation][2]: the best introduction to automata theory, ...
If you would like to have a general introduction without getting to deep into the technical details, I suggest David Harel's [Algorithmics: The Spirit of Computing][1]. After that, this is my favorite list: - Michael Sipser's [Introduction to the Theory of Computation][2]: the best introduction to automata theory, ...
- Cormen's [Introduction to Algorithms][1] is a popular choice, title speaks for itself. - [Compilers: Principles, Techniques, And Tools][2] by Aho, Ulman and Sethi is a good book about compilers, has some introduction material about automata theory too. - [Model Checking][3] by Clarke is a classic text on auto...
Programming languages evolve and are improved with time. People take ideas from different languages and combine them into a new languages. Some features are improved (inheritance mechanisms, type systems), some are added (garbage collection, exception handling), some are removed (`goto` statements, low-level pointer...
Fully connected (at least layer to layer with more than 2 hidden layers) backprop networks are universal learners. Unfortunately, they are often slow to learn and tend to over-fit or have awkward generalizations. From fooling around with these networks, I have observed that pruning some of the edges (so that their ...
In one of the programming tutorials at my university, we asked students to compare the performance of quicksort, mergesort, insertion sort vs. Python's built-in list.sort (called [Timsort][1]). The experimental results surprised me deeply since the built-in list.sort performed so much better than other sorting algorith...
Fewer nodes/edges (or edges with fixed weights) means that there are fewer parameters whose values need to be found, and this typically reduces the time to learn. Also, when there are fewer parameters, the _space_ that can be expressed by the neural network has fewer dimensions, so the neural network can only express m...
- Cormen's [Introduction to Algorithms][1] is a popular choice, title speaks for itself. - [Compilers: Principles, Techniques, And Tools][2] by Aho, Ulman and Sethi is a good book about compilers, has some introduction material about automata theory too. - [Principles of Model Checking][3] is a massive book can...
We know post-order, post L(x) => [x] post N(x,l,r) => (post l) ++ (post r) ++ [x] and pre-order pre L(x) => [x] pre N(x,l,r) => [x] ++ (pre l) ++ (pre r) and in-order traversal resp. sequentialisation. in L(x) => [x] in N(x,l,r) => (in l) ++ [x] ++ (in r) One can...