id
int64
1
141k
title
stringlengths
15
150
body
stringlengths
45
28.5k
tags
stringlengths
1
102
label
int64
1
1
text
stringlengths
128
28.6k
source
stringclasses
1 value
2
Does the 'difference' operation add expressiveness to a query language that already includes 'join'?
<p>The set difference operator (e.g., <code>EXCEPT</code> in some SQL variants) is one of the many fundamental operators of relational algebra. However, there are some databases that do not support the set difference operator directly, but which support <code>LEFT JOIN</code> (a kind of outer join), and in practice thi...
database theory relational algebra finite model theory
1
Does the 'difference' operation add expressiveness to a query language that already includes 'join'? -- (database theory relational algebra finite model theory) <p>The set difference operator (e.g., <code>EXCEPT</code> in some SQL variants) is one of the many fundamental operators of relational algebra. However, there ...
habedi/stack-exchange-dataset
3
Why is quicksort better than other sorting algorithms in practice?
<p>In a standard algorithms course we are taught that <strong>quicksort</strong> is <span class="math-container">$O(n \log n)$</span> on average and <span class="math-container">$O(n^2)$</span> in the worst case. At the same time, other sorting algorithms are studied which are <span class="math-container">$O(n \log n)$...
algorithms sorting
1
Why is quicksort better than other sorting algorithms in practice? -- (algorithms sorting) <p>In a standard algorithms course we are taught that <strong>quicksort</strong> is <span class="math-container">$O(n \log n)$</span> on average and <span class="math-container">$O(n^2)$</span> in the worst case. At the same time...
habedi/stack-exchange-dataset
5
Does cooperative scheduling suspend processes when they perform an I/O operation?
<p>Many operating systems references say that with cooperative (as opposed to preemptive) multitasking, a process keeps the CPU until it explicitly voluntarily suspends itself. If a running process performs an I/O request that cannot be immediately satisfied (e.g., requests a key stroke that is not yet available), doe...
operating systems process scheduling
1
Does cooperative scheduling suspend processes when they perform an I/O operation? -- (operating systems process scheduling) <p>Many operating systems references say that with cooperative (as opposed to preemptive) multitasking, a process keeps the CPU until it explicitly voluntarily suspends itself. If a running proc...
habedi/stack-exchange-dataset
11
Generating Combinations from a set of pairs without repetition of elements
<p>I have a set of pairs. Each pair is of the form (x,y) such that x,y belong to integers from the range <code>[0,n)</code>.</p>&#xA;&#xA;<p>So, if the n is 4, then I have the following pairs:</p>&#xA;&#xA;<pre><code>(0,1) (0,2) (0,3)&#xA;(1,2) (1,3) &#xA;(2,3) &#xA;</code></pre>&#xA;&#xA;<p>I already have the pairs. N...
algorithms
1
Generating Combinations from a set of pairs without repetition of elements -- (algorithms) <p>I have a set of pairs. Each pair is of the form (x,y) such that x,y belong to integers from the range <code>[0,n)</code>.</p>&#xA;&#xA;<p>So, if the n is 4, then I have the following pairs:</p>&#xA;&#xA;<pre><code>(0,1) (0,2) ...
habedi/stack-exchange-dataset
14
What is the significance of context-sensitive (Type 1) languages?
<p>Seeing that in the <a href="http://en.wikipedia.org/wiki/Chomsky_hierarchy">Chomsky Hierarchy</a> Type 3 languages can be recognised by a state machine with no external memory (i.e., a finite automaton), Type 2 by a state machine with a <em>single</em> stack (i.e. a push-down automaton) and Type 0 by a state machine...
formal languages applied theory computability automata formal grammars
1
What is the significance of context-sensitive (Type 1) languages? -- (formal languages applied theory computability automata formal grammars) <p>Seeing that in the <a href="http://en.wikipedia.org/wiki/Chomsky_hierarchy">Chomsky Hierarchy</a> Type 3 languages can be recognised by a state machine with no external memory...
habedi/stack-exchange-dataset
20
Evaluating the average time complexity of a given bubblesort algorithm.
<p>Considering this pseudo-code of a bubblesort:</p>&#xA;&#xA;<pre><code>FOR i := 0 TO arraylength(list) STEP 1 &#xA; switched := false&#xA; FOR j := 0 TO arraylength(list)-(i+1) STEP 1&#xA; IF list[j] &gt; list[j + 1] THEN&#xA; switch(list,j,j+1)&#xA; switched := true&#xA; EN...
algorithms time complexity sorting average case
1
Evaluating the average time complexity of a given bubblesort algorithm. -- (algorithms time complexity sorting average case) <p>Considering this pseudo-code of a bubblesort:</p>&#xA;&#xA;<pre><code>FOR i := 0 TO arraylength(list) STEP 1 &#xA; switched := false&#xA; FOR j := 0 TO arraylength(list)-(i+1) STEP 1&#x...
habedi/stack-exchange-dataset
27
Clever memory management with constant time operations?
<p>Let's consider a memory segment (whose size can grow or shrink, like a file, when needed) on which you can perform two basic memory allocation operations involving fixed size blocks:</p>&#xA;&#xA;<ul>&#xA;<li>allocation of one block</li>&#xA;<li>freeing a previously allocated block which is not used anymore.</li>&#...
time complexity memory allocation operating systems
1
Clever memory management with constant time operations? -- (time complexity memory allocation operating systems) <p>Let's consider a memory segment (whose size can grow or shrink, like a file, when needed) on which you can perform two basic memory allocation operations involving fixed size blocks:</p>&#xA;&#xA;<ul>&#xA...
habedi/stack-exchange-dataset
33
Rice's theorem for non-semantic properties
<p><a href="http://en.wikipedia.org/wiki/Rice%27s_theorem">Rice's theorem</a> tell us that the only <em>semantic</em> properties of <a href="http://en.wikipedia.org/wiki/Turing_machines">Turing Machines</a> (i.e. the properties of the function computed by the machine) that we can decide are the two trivial properties (...
computability undecidability
1
Rice's theorem for non-semantic properties -- (computability undecidability) <p><a href="http://en.wikipedia.org/wiki/Rice%27s_theorem">Rice's theorem</a> tell us that the only <em>semantic</em> properties of <a href="http://en.wikipedia.org/wiki/Turing_machines">Turing Machines</a> (i.e. the properties of the function...
habedi/stack-exchange-dataset
43
Language theoretic comparison of LL and LR grammars
<p>People often say that <a href="https://en.wikipedia.org/wiki/LR_parser">LR(k)</a> parsers are more powerful than <a href="https://en.wikipedia.org/wiki/LL_parser">LL(k)</a> parsers. These statements are vague most of the time; in particular, should we compare the classes for a fixed $k$ or the union over all $k$? So...
formal languages formal grammars parsers reference question
1
Language theoretic comparison of LL and LR grammars -- (formal languages formal grammars parsers reference question) <p>People often say that <a href="https://en.wikipedia.org/wiki/LR_parser">LR(k)</a> parsers are more powerful than <a href="https://en.wikipedia.org/wiki/LL_parser">LL(k)</a> parsers. These statements a...
habedi/stack-exchange-dataset
57
How does one know which notation of time complexity analysis to use?
<p>In most introductory algorithm classes, notations like $O$ (Big O) and $\Theta$ are introduced, and a student would typically learn to use one of these to find the time complexity.</p>&#xA;&#xA;<p>However, there are other notations, such as $o$, $\Omega$ and $\omega$. Are there any specific scenarios where one notat...
algorithms terminology asymptotics landau notation reference question
1
How does one know which notation of time complexity analysis to use? -- (algorithms terminology asymptotics landau notation reference question) <p>In most introductory algorithm classes, notations like $O$ (Big O) and $\Theta$ are introduced, and a student would typically learn to use one of these to find the time comp...
habedi/stack-exchange-dataset
62
Characterization of lambda-terms that have union types
<p>Many textbooks cover intersection types in the lambda-calculus. The typing rules for intersection can be defined as follows (on top of the simply typed lambda-calculus with subtyping):</p>&#xA;&#xA;<p>$$&#xD;&#xA;\dfrac{\Gamma \vdash M : T_1 \quad \Gamma \vdash M : T_2}&#xD;&#xA; {\Gamma \vdash M : T_1 \wedge T...
lambda calculus type theory logic
1
Characterization of lambda-terms that have union types -- (lambda calculus type theory logic) <p>Many textbooks cover intersection types in the lambda-calculus. The typing rules for intersection can be defined as follows (on top of the simply typed lambda-calculus with subtyping):</p>&#xA;&#xA;<p>$$&#xD;&#xA;\dfrac{\Ga...
habedi/stack-exchange-dataset
73
Which kind of branch prediction is more important?
<p>I have observed that there are two different types of states in branch prediction.</p>&#xA;&#xA;<ol>&#xA;<li><p>In superscalar execution, where the branch prediction is very important, and it is mainly in execution delay rather than fetch delay.</p></li>&#xA;<li><p>In the instruction pipeline, where the fetching is ...
cpu pipelines computer architecture
1
Which kind of branch prediction is more important? -- (cpu pipelines computer architecture) <p>I have observed that there are two different types of states in branch prediction.</p>&#xA;&#xA;<ol>&#xA;<li><p>In superscalar execution, where the branch prediction is very important, and it is mainly in execution delay rath...
habedi/stack-exchange-dataset
74
Is Smoothed Analysis used outside academia?
<p>Did the <a href="http://en.wikipedia.org/wiki/Smoothed_analysis">smoothed analysis</a> find its way into main stream analysis of algorithms? Is it common for algorithm designers to apply smoothed analysis to their algorithms?</p>&#xA;
algorithms complexity theory algorithm analysis
1
Is Smoothed Analysis used outside academia? -- (algorithms complexity theory algorithm analysis) <p>Did the <a href="http://en.wikipedia.org/wiki/Smoothed_analysis">smoothed analysis</a> find its way into main stream analysis of algorithms? Is it common for algorithm designers to apply smoothed analysis to their algori...
habedi/stack-exchange-dataset
102
Is there any nongeneral CFG parsing algorithm that recognises EPAL?
<p>EPAL, the language of even palindromes, is defined as the language generated by the following unambiguous context-free grammar:</p>&#xA;<blockquote>&#xA;<p><span class="math-container">$S \rightarrow a a$</span></p>&#xA;<p><span class="math-container">$S \rightarrow b b$</span></p>&#xA;<p><span class="math-container...
formal languages formal grammars parsers
1
Is there any nongeneral CFG parsing algorithm that recognises EPAL? -- (formal languages formal grammars parsers) <p>EPAL, the language of even palindromes, is defined as the language generated by the following unambiguous context-free grammar:</p>&#xA;<blockquote>&#xA;<p><span class="math-container">$S \rightarrow a a...
habedi/stack-exchange-dataset
105
Algorithm to test whether a binary tree is a search tree and count complete branches
<p>I need to create a recursive algorithm to see if a binary tree is a binary search tree as well as count how many complete branches are there (a parent node with both left and right children nodes) with an assumed global counting variable. This is an assignment for my data structures class. </p>&#xA;&#xA;<p>So far I ...
algorithms recursion trees
1
Algorithm to test whether a binary tree is a search tree and count complete branches -- (algorithms recursion trees) <p>I need to create a recursive algorithm to see if a binary tree is a binary search tree as well as count how many complete branches are there (a parent node with both left and right children nodes) wit...
habedi/stack-exchange-dataset
109
Are there inherently ambiguous and deterministic context-free languages?
<p>Let us call a context-free language deterministic if and only if it can be accepted by a deterministic push-down automaton, and nondeterministic otherwise.</p>&#xA;&#xA;<p>Let us call a context-free language inherently ambiguous if and only if all context-free grammars which generate the language are ambiguous, and ...
formal languages automata formal grammars pushdown automata
1
Are there inherently ambiguous and deterministic context-free languages? -- (formal languages automata formal grammars pushdown automata) <p>Let us call a context-free language deterministic if and only if it can be accepted by a deterministic push-down automaton, and nondeterministic otherwise.</p>&#xA;&#xA;<p>Let us ...
habedi/stack-exchange-dataset
110
Determining capabilities of a min-heap (or other exotic) state machines
<p><em>See the end of this post for some clarification on the definition(s) of min-heap automata.</em></p>&#xA;&#xA;<p>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. Stat...
formal languages automata
1
Determining capabilities of a min-heap (or other exotic) state machines -- (formal languages automata) <p><em>See the end of this post for some clarification on the definition(s) of min-heap automata.</em></p>&#xA;&#xA;<p>One can imagine using a variety of data structures for storing information for use by state machin...
habedi/stack-exchange-dataset
118
Are there improvements on Dana Angluin's algorithm for learning regular sets
<p>In her 1987 seminal paper Dana Angluin presents a polynomial time algorithm for learning a DFA from membership queries and theory queries (counterexamples to a proposed DFA).</p>&#xA;<p>She shows that if you are trying to learn a minimal DFA with <span class="math-container">$n$</span> states, and your largest count...
algorithms learning theory machine learning
1
Are there improvements on Dana Angluin's algorithm for learning regular sets -- (algorithms learning theory machine learning) <p>In her 1987 seminal paper Dana Angluin presents a polynomial time algorithm for learning a DFA from membership queries and theory queries (counterexamples to a proposed DFA).</p>&#xA;<p>She s...
habedi/stack-exchange-dataset
119
How fundamental are matroids and greedoids in algorithm design?
<p>Initially, <a href="http://en.wikipedia.org/wiki/Matroid" rel="nofollow noreferrer">matroids</a> were introduced to generalize the notions of linear independence of a collection of subsets $E$ over some ground set $I$. Certain problems that contain this structure permit greedy algorithms to find optimal solutions. T...
algorithms optimization combinatorics greedy algorithms matroids
1
How fundamental are matroids and greedoids in algorithm design? -- (algorithms optimization combinatorics greedy algorithms matroids) <p>Initially, <a href="http://en.wikipedia.org/wiki/Matroid" rel="nofollow noreferrer">matroids</a> were introduced to generalize the notions of linear independence of a collection of su...
habedi/stack-exchange-dataset
122
What Is The Complexity of Implementing a Particle Filter?
<p>In a <a href="http://www.youtube.com/watch?feature=player_embedded&amp;v=4S-sx5_cmLU#!" rel="noreferrer">video</a> discussing the merits of <a href="http://en.wikipedia.org/wiki/Particle_filter" rel="noreferrer">particle filters</a> for localization, it was implied that there is some ambiguity about the complexity c...
computational geometry knowledge representation reasoning statistics
1
What Is The Complexity of Implementing a Particle Filter? -- (computational geometry knowledge representation reasoning statistics) <p>In a <a href="http://www.youtube.com/watch?feature=player_embedded&amp;v=4S-sx5_cmLU#!" rel="noreferrer">video</a> discussing the merits of <a href="http://en.wikipedia.org/wiki/Particl...
habedi/stack-exchange-dataset
125
How to define quantum Turing machines?
<p>In quantum computation, what is the equivalent model of a Turing machine? &#xA;It is quite clear to me how quantum <strong>circuits</strong> can be constructed out of quantum gates, but how can we define a quantum Turing machine (QTM) that can actually benefit from quantum effects, namely, perform on high-dimensiona...
quantum computing turing machines computation models
1
How to define quantum Turing machines? -- (quantum computing turing machines computation models) <p>In quantum computation, what is the equivalent model of a Turing machine? &#xA;It is quite clear to me how quantum <strong>circuits</strong> can be constructed out of quantum gates, but how can we define a quantum Turing...
habedi/stack-exchange-dataset
129
Do subqueries add expressive power to SQL queries?
<p>Does SQL need subqueries?</p>&#xA;&#xA;<p>Imagine a sufficiently generalized implementation of the structured query language for relation databases. Since the structure of the canonical SQL <code>SELECT</code> statement is actually pretty important for this to make sense, I don't appeal directly to relational algeb...
database theory relational algebra
1
Do subqueries add expressive power to SQL queries? -- (database theory relational algebra) <p>Does SQL need subqueries?</p>&#xA;&#xA;<p>Imagine a sufficiently generalized implementation of the structured query language for relation databases. Since the structure of the canonical SQL <code>SELECT</code> statement is ac...
habedi/stack-exchange-dataset
130
What are the conditions for a NFA for its equivalent DFA to be maximal in size?
<p>We know that DFAs are equivalent to NFAs in expressiveness power; there is also a known algorithm for converting NFAs to DFAs (unfortunately I do now know the inventor of that algorithm), which in worst case gives us $2^S$ states, if our NFA had $S$ states.</p>&#xA;&#xA;<p>My question is: what is determining the wor...
formal languages automata regular languages finite automata nondeterminism
1
What are the conditions for a NFA for its equivalent DFA to be maximal in size? -- (formal languages automata regular languages finite automata nondeterminism) <p>We know that DFAs are equivalent to NFAs in expressiveness power; there is also a known algorithm for converting NFAs to DFAs (unfortunately I do now know th...
habedi/stack-exchange-dataset
134
Analyzing load balancing schemes to minimize overall execution time
<p>Suppose that a certain parallel application uses a master-slave design to process a large number of workloads. Each workload takes some number of cycles to complete; the number of cycles any given workload will take is given by a known random variable $X$. Assume that there are $n$ such workloads and $m$ equivalent ...
scheduling distributed systems parallel computing
1
Analyzing load balancing schemes to minimize overall execution time -- (scheduling distributed systems parallel computing) <p>Suppose that a certain parallel application uses a master-slave design to process a large number of workloads. Each workload takes some number of cycles to complete; the number of cycles any giv...
habedi/stack-exchange-dataset
138
Natural occurrences of monads that make use of the category-theoretical framework
<p>Today, a talk by Henning Kerstan ("Trace Semantics for Probabilistic Transition Systems") confronted me with category theory for the first time. He has built a theoretical framework for describing probablistic transition systems and their behaviour in a general way, i.e. with uncountably infinite state sets and diff...
applied theory category theory
1
Natural occurrences of monads that make use of the category-theoretical framework -- (applied theory category theory) <p>Today, a talk by Henning Kerstan ("Trace Semantics for Probabilistic Transition Systems") confronted me with category theory for the first time. He has built a theoretical framework for describing pr...
habedi/stack-exchange-dataset
143
Is this finite graph problem decidable? What factors make a problem decidable?
<p>I want to know if the following problem is decidable and how to find out. Every problem I see I can say "yes" or "no" to it, so are most problems and algorithms decidable except a few (which is provided <a href="http://en.wikipedia.org/wiki/List_of_undecidable_problems">here</a>)?</p>&#xA;&#xA;<blockquote>&#xA; <p>...
algorithms computability graphs undecidability
1
Is this finite graph problem decidable? What factors make a problem decidable? -- (algorithms computability graphs undecidability) <p>I want to know if the following problem is decidable and how to find out. Every problem I see I can say "yes" or "no" to it, so are most problems and algorithms decidable except a few (w...
habedi/stack-exchange-dataset
146
Equivalence of Kolmogorov-Complexity definitions
<p>There are many ways to define the <a href="https://en.wikipedia.org/wiki/Kolmogorov_complexity">Kolmogorov-Complexity</a>, and usually, all these definitions they are equivalent up to an additive constant. That is if $K_1$ and $K_2$ are kolmogorov complexity functions (defined via different languages or models), the...
computability kolmogorov complexity
1
Equivalence of Kolmogorov-Complexity definitions -- (computability kolmogorov complexity) <p>There are many ways to define the <a href="https://en.wikipedia.org/wiki/Kolmogorov_complexity">Kolmogorov-Complexity</a>, and usually, all these definitions they are equivalent up to an additive constant. That is if $K_1$ and ...
habedi/stack-exchange-dataset
148
Type-checking algorithms
<p>I am starting a personal bibliographic research on type-checking algorithms and want some tips. What are the most commonly used type-checking algorithms, strategies and general techniques?</p>&#xA;&#xA;<p>I am particularly interested in complex type-checking algorithms that were implemented in widely known strongly ...
algorithms programming languages reference request type checking
1
Type-checking algorithms -- (algorithms programming languages reference request type checking) <p>I am starting a personal bibliographic research on type-checking algorithms and want some tips. What are the most commonly used type-checking algorithms, strategies and general techniques?</p>&#xA;&#xA;<p>I am particularly...
habedi/stack-exchange-dataset
154
Is there an equivalent of van Emde Boas trees for ropes?
<p>Someone I know is planning on implementing a text editor in the near future, which prompted me to think about what kind of data structures are fast for a text editor. The most used structures are apparently <a href="http://en.wikipedia.org/wiki/Rope_%28computer_science%29">ropes</a> or <a href="http://en.wikipedia.o...
data structures
1
Is there an equivalent of van Emde Boas trees for ropes? -- (data structures) <p>Someone I know is planning on implementing a text editor in the near future, which prompted me to think about what kind of data structures are fast for a text editor. The most used structures are apparently <a href="http://en.wikipedia.org...
habedi/stack-exchange-dataset
156
A sufficient and necessary condition about regularity of a language
<blockquote>&#xA; <p>Which of the following statements is correct? </p>&#xA; &#xA; <ol>&#xA; <li>sufficient and necessary conditions about regularity of a language exist but not discovered yet.</li>&#xA; <li><p>There's no sufficient and necessary condition about regularity of a&#xA; language.</p></li>&#xA; <li...
formal languages regular languages
1
A sufficient and necessary condition about regularity of a language -- (formal languages regular languages) <blockquote>&#xA; <p>Which of the following statements is correct? </p>&#xA; &#xA; <ol>&#xA; <li>sufficient and necessary conditions about regularity of a language exist but not discovered yet.</li>&#xA; <...
habedi/stack-exchange-dataset
164
What are the possible sets of word lengths in a regular language?
<p>Given a language $L$, define the length set of $L$ as the set of lengths of words in $L$:&#xA;$$\mathrm{LS}(L) = \{|u| \mid u \in L \}$$</p>&#xA;&#xA;<p>Which sets of integers can be the length set of a regular language?</p>&#xA;
formal languages computability regular languages finite automata
1
What are the possible sets of word lengths in a regular language? -- (formal languages computability regular languages finite automata) <p>Given a language $L$, define the length set of $L$ as the set of lengths of words in $L$:&#xA;$$\mathrm{LS}(L) = \{|u| \mid u \in L \}$$</p>&#xA;&#xA;<p>Which sets of integers can b...
habedi/stack-exchange-dataset
168
Efficient compression of unlabeled trees
<p>Consider unlabeled, rooted binary trees. We can <em>compress</em> such trees: whenever there are pointers to subtrees $T$ and $T'$ with $T = T'$ (interpreting $=$ as structural equality), we store (w.l.o.g.) $T$ and replace all pointers to $T'$ with pointers to $T$. See <a href="https://cs.stackexchange.com/a/177/98...
algorithms data structures trees binary trees
1
Efficient compression of unlabeled trees -- (algorithms data structures trees binary trees) <p>Consider unlabeled, rooted binary trees. We can <em>compress</em> such trees: whenever there are pointers to subtrees $T$ and $T'$ with $T = T'$ (interpreting $=$ as structural equality), we store (w.l.o.g.) $T$ and replace a...
habedi/stack-exchange-dataset
178
Is there a "natural" undecidable language?
<p>Is there any "natural" language which is undecidable?</p>&#xA;&#xA;<p>by "natural" I mean a language defined directly by properties of strings, and not via machines and their equivalent. In other words, if the language looks like&#xA;$$ L = \{ \langle M \rangle \mid \ldots \}$$&#xA;where $M$ is a TM, DFA (or regular...
formal languages automata computability undecidability
1
Is there a "natural" undecidable language? -- (formal languages automata computability undecidability) <p>Is there any "natural" language which is undecidable?</p>&#xA;&#xA;<p>by "natural" I mean a language defined directly by properties of strings, and not via machines and their equivalent. In other words, if the lang...
habedi/stack-exchange-dataset
194
The time complexity of finding the diameter of a graph
<blockquote>&#xA; <p>What is the time complexity of finding the diameter of a graph&#xA; $G=(V,E)$?</p>&#xA; &#xA; <ul>&#xA; <li>${O}(|V|^2)$</li>&#xA; <li>${O}(|V|^2+|V| \cdot |E|)$</li>&#xA; <li>${O}(|V|^2\cdot |E|)$</li>&#xA; <li>${O}(|V|\cdot |E|^2)$</li>&#xA; </ul>&#xA;</blockquote>&#xA;&#xA;<p>The diamet...
algorithms time complexity graphs
1
The time complexity of finding the diameter of a graph -- (algorithms time complexity graphs) <blockquote>&#xA; <p>What is the time complexity of finding the diameter of a graph&#xA; $G=(V,E)$?</p>&#xA; &#xA; <ul>&#xA; <li>${O}(|V|^2)$</li>&#xA; <li>${O}(|V|^2+|V| \cdot |E|)$</li>&#xA; <li>${O}(|V|^2\cdot |E|)$<...
habedi/stack-exchange-dataset
206
Is an infinite union of context-free languages always context-free?
<p>Let $L_1$, $L_2$, $L_3$, $\dots$ be an infinite sequence of context-free languages, each of&#xA;which is defined over a common alphabet $Σ$. Let $L$ be the infinite union of $L_1$, $L_2$, $L_3$, $\dots $;&#xA;i.e., $L = L_1 \cup L_2 \cup L_3 \cup \dots $. </p>&#xA;&#xA;<p>Is it always the case that $L$ is a context-fre...
formal languages context free closure properties
1
Is an infinite union of context-free languages always context-free? -- (formal languages context free closure properties) <p>Let $L_1$, $L_2$, $L_3$, $\dots$ be an infinite sequence of context-free languages, each of&#xA;which is defined over a common alphabet $Σ$. Let $L$ be the infinite union of $L_1$, $L_2$, $L_3$, $\do...
habedi/stack-exchange-dataset
210
Why polynomial time is called "efficient"?
<p>Why in computer science any complexity which is at most polynomial is considered efficient?</p>&#xA;&#xA;<p>For any practical application<sup>(a)</sup>, algorithms with complexity $n^{\log n}$ are way faster than algorithms that run in time, say, $n^{80}$, but the first is considered inefficient while the latter is ...
algorithms complexity theory terminology efficiency
1
Why polynomial time is called "efficient"? -- (algorithms complexity theory terminology efficiency) <p>Why in computer science any complexity which is at most polynomial is considered efficient?</p>&#xA;&#xA;<p>For any practical application<sup>(a)</sup>, algorithms with complexity $n^{\log n}$ are way faster than algo...
habedi/stack-exchange-dataset
219
Implementing the GSAT algorithm - How to select which literal to flip?
<p>The GSAT algorithm is, for the most part, straight forward: You get a formula in conjunctive normal form and flip the literals of the clauses until you find a solution that satisfies the formula or you reach the max_tries/max_flips limit and find no solution.</p>&#xA;&#xA;<p>I'm implementing the following algorithm:...
algorithms satisfiability 3 sat
1
Implementing the GSAT algorithm - How to select which literal to flip? -- (algorithms satisfiability 3 sat) <p>The GSAT algorithm is, for the most part, straight forward: You get a formula in conjunctive normal form and flip the literals of the clauses until you find a solution that satisfies the formula or you reach t...
habedi/stack-exchange-dataset
221
Identifying events related to dates in a paragraph
<p>Is there an <s><em>algorithmic</em></s> approach to identify that dates given in a paragraph correlate to particular events (phrases) in the paragraph?</p>&#xA;<p>Example, consider the following paragraph:</p>&#xA;<blockquote>&#xA;<p>In June 1970, the great leader took the oath. But it was only after May 1972, post ...
algorithms data mining natural language processing
1
Identifying events related to dates in a paragraph -- (algorithms data mining natural language processing) <p>Is there an <s><em>algorithmic</em></s> approach to identify that dates given in a paragraph correlate to particular events (phrases) in the paragraph?</p>&#xA;<p>Example, consider the following paragraph:</p>&...
habedi/stack-exchange-dataset
222
Easy reduction from 3SAT to Hamiltonian path problem
<p>There is a reduction in Sipser's book "Introduction to the theory of computation" on page 286 from 3SAT to Hamiltonian path problem. </p>&#xA;&#xA;<blockquote>&#xA; <p>Is there a simpler reduction?</p>&#xA;</blockquote>&#xA;&#xA;<p>By simpler I mean a reduction that would be easier to understand (for students).</p>...
complexity theory np hard
1
Easy reduction from 3SAT to Hamiltonian path problem -- (complexity theory np hard) <p>There is a reduction in Sipser's book "Introduction to the theory of computation" on page 286 from 3SAT to Hamiltonian path problem. </p>&#xA;&#xA;<blockquote>&#xA; <p>Is there a simpler reduction?</p>&#xA;</blockquote>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
223
Stability for couples in the Stable Matching Problem
<p>In the <a href="http://en.wikipedia.org/wiki/Stable_marriage_problem" rel="nofollow">Stable Matching Problem</a>, it is stated that there can exist cases where the $m$ list of men can be content with their decisions, yet the list of $f$ cannot when the algorithm is run with men's proposals.</p>&#xA;&#xA;<p>From what...
combinatorics
1
Stability for couples in the Stable Matching Problem -- (combinatorics) <p>In the <a href="http://en.wikipedia.org/wiki/Stable_marriage_problem" rel="nofollow">Stable Matching Problem</a>, it is stated that there can exist cases where the $m$ list of men can be content with their decisions, yet the list of $f$ cannot w...
habedi/stack-exchange-dataset
226
Round-robin scheduling: allow listing a process multiple times?
<p>In a round-robin scheduler, adding a process multiple times to the process list is a cheap way to give it higher priority.</p>&#xA;&#xA;<p>I wonder how practical an approach this might be. What benefit does it have over other techniques such as giving the process a longer time slice (benefit: less switching time) or...
operating systems process scheduling
1
Round-robin scheduling: allow listing a process multiple times? -- (operating systems process scheduling) <p>In a round-robin scheduler, adding a process multiple times to the process list is a cheap way to give it higher priority.</p>&#xA;&#xA;<p>I wonder how practical an approach this might be. What benefit does it h...
habedi/stack-exchange-dataset
231
Problems Implementing Closures in Non-functional Settings
<p>In programming languages, closures are a popular and often desired feature. <a href="https://en.wikipedia.org/wiki/Closure_%28computer_science%29">Wikipedia</a> says (emphasis mine):</p>&#xA;&#xA;<blockquote>&#xA; <p>In computer science, a closure (...) is a <strong>function together with a referencing environment<...
programming languages semantics
1
Problems Implementing Closures in Non-functional Settings -- (programming languages semantics) <p>In programming languages, closures are a popular and often desired feature. <a href="https://en.wikipedia.org/wiki/Closure_%28computer_science%29">Wikipedia</a> says (emphasis mine):</p>&#xA;&#xA;<blockquote>&#xA; <p>In c...
habedi/stack-exchange-dataset
234
Parsing arbitrary context-free grammars, mostly short snippets
<p>I want to parse user-defined domain specific languages. These languages are typically close to mathematical notations (I am not parsing a natural language). Users define their DSL in a BNF notation, like this:</p>&#xA;&#xA;<pre><code>expr ::= LiteralInteger&#xA; | ( expr )&#xA; | expr + expr&#xA; |...
formal languages parsers compilers
1
Parsing arbitrary context-free grammars, mostly short snippets -- (formal languages parsers compilers) <p>I want to parse user-defined domain specific languages. These languages are typically close to mathematical notations (I am not parsing a natural language). Users define their DSL in a BNF notation, like this:</p>&...
habedi/stack-exchange-dataset
245
Influence of the dimension of cellular automata on complexity classes
<p>Let's take as an example the 3d → 2d reduction: What's the cost of simulating a 3d cellular automaton by a 2d cellular automaton?</p>&#xA;&#xA;<p>Here is a bunch of more specific questions:</p>&#xA;&#xA;<ol>&#xA;<li><p>What kind of algorithms will have their time complexity changed, by how much?</p></li>&#xA;<li><p>...
complexity theory time complexity cellular automata
1
Influence of the dimension of cellular automata on complexity classes -- (complexity theory time complexity cellular automata) <p>Let's take as an example the 3d → 2d reduction: What's the cost of simulating a 3d cellular automaton by a 2d cellular automaton?</p>&#xA;&#xA;<p>Here is a bunch of more specific questions:<...
habedi/stack-exchange-dataset
246
Reflection on Concurrency
<p><a href="http://en.wikipedia.org/wiki/Reflection_%28computer_programming%29" rel="nofollow">Reflection</a> is a common mechanism for accessing and changing the structure of a program at run-time, found in many dynamic programming languages such as Smalltalk, Ruby and Python, and in impoverished form in Java and (hen...
programming languages semantics concurrency reflection
1
Reflection on Concurrency -- (programming languages semantics concurrency reflection) <p><a href="http://en.wikipedia.org/wiki/Reflection_%28computer_programming%29" rel="nofollow">Reflection</a> is a common mechanism for accessing and changing the structure of a program at run-time, found in many dynamic programming l...
habedi/stack-exchange-dataset
248
Analyzing a modified version of the card-game "War"
<p>A simple game usually played by children, the game of War is played by two people using a standard deck of 52 playing cards. Initially, the deck is shuffled and all cards are dealt two the two players, so that each have 26 random cards in a random order. We will assume that players are allowed to examine (but not ch...
algorithms optimization
1
Analyzing a modified version of the card-game "War" -- (algorithms optimization) <p>A simple game usually played by children, the game of War is played by two people using a standard deck of 52 playing cards. Initially, the deck is shuffled and all cards are dealt two the two players, so that each have 26 random cards ...
habedi/stack-exchange-dataset
257
How is a JIT compiler different from an ordinary compiler?
<p>There's been a lot of hype about JIT compilers for languages like Java, Ruby, and Python. How are JIT compilers different from C/C++ compilers, and why are the compilers written for Java, Ruby or Python called JIT compilers, while C/C++ compilers are just called compilers?</p>&#xA;
compilers
1
How is a JIT compiler different from an ordinary compiler? -- (compilers) <p>There's been a lot of hype about JIT compilers for languages like Java, Ruby, and Python. How are JIT compilers different from C/C++ compilers, and why are the compilers written for Java, Ruby or Python called JIT compilers, while C/C++ compil...
habedi/stack-exchange-dataset
261
How to determine likely connections in a social network?
<p>I am curious in determining an approach to tackling a "suggested friends" algorithm.</p>&#xA;&#xA;<p><a href="http://facebook.com" rel="nofollow noreferrer">Facebook</a> has a feature in which it will recommended individuals to you which it thinks you may be acquainted with. These users normally (excluding the edge ...
algorithms machine learning modelling social networks
1
How to determine likely connections in a social network? -- (algorithms machine learning modelling social networks) <p>I am curious in determining an approach to tackling a "suggested friends" algorithm.</p>&#xA;&#xA;<p><a href="http://facebook.com" rel="nofollow noreferrer">Facebook</a> has a feature in which it will ...
habedi/stack-exchange-dataset
265
How to prove that a language is not context-free?
<p>We learned about the class of context-free languages $\mathrm{CFL}$. It is characterised by both <a href="https://en.wikipedia.org/wiki/Context-free_grammar">context-free grammars</a> and <a href="https://en.wikipedia.org/wiki/Pushdown_automata">pushdown automata</a> so it is easy to show that a given language is co...
formal languages context free proof techniques reference question
1
How to prove that a language is not context-free? -- (formal languages context free proof techniques reference question) <p>We learned about the class of context-free languages $\mathrm{CFL}$. It is characterised by both <a href="https://en.wikipedia.org/wiki/Context-free_grammar">context-free grammars</a> and <a href=...
habedi/stack-exchange-dataset
266
Why are the total functions not enumerable?
<p>We learned about the concept of enumerations of functions. In practice, they correspond to programming languages.</p>&#xA;&#xA;<p>In a passing remark, the professor mentioned that the class of all total functions (i.e. the functions that always terminate for every input) is <em>not</em> enumerable. That would mean t...
computability semi decidability enumeration
1
Why are the total functions not enumerable? -- (computability semi decidability enumeration) <p>We learned about the concept of enumerations of functions. In practice, they correspond to programming languages.</p>&#xA;&#xA;<p>In a passing remark, the professor mentioned that the class of all total functions (i.e. the f...
habedi/stack-exchange-dataset
269
Why would anyone want CISC?
<p>In our computer systems lecture we were introduced to the MIPS processor. It was (re)developed over the course of the term and has in fact been quite easy to understand. It uses a <a href="https://en.wikipedia.org/wiki/Reduced_instruction_set_computing">RISC</a> design, that is its elementary commands are regularly ...
computer architecture
1
Why would anyone want CISC? -- (computer architecture) <p>In our computer systems lecture we were introduced to the MIPS processor. It was (re)developed over the course of the term and has in fact been quite easy to understand. It uses a <a href="https://en.wikipedia.org/wiki/Reduced_instruction_set_computing">RISC</a>...
habedi/stack-exchange-dataset
270
Hash tables versus binary trees
<p>When implementing a dictionary ('I want to look up customer data by their customer IDs'), the typical data structures used are hash tables and binary search trees. I know for instance that the C++ STL library implements dictionaries (they call them maps) using (balanced) binary search trees, and the .NET framework u...
algorithms data structures binary trees hash tables
1
Hash tables versus binary trees -- (algorithms data structures binary trees hash tables) <p>When implementing a dictionary ('I want to look up customer data by their customer IDs'), the typical data structures used are hash tables and binary search trees. I know for instance that the C++ STL library implements dictiona...
habedi/stack-exchange-dataset
271
Is there an abstract machine that can capture power consumption?
<p>When reporting algorithmic complexity of an algorithm, one assumes the underlying computations are performed on some abstract machine (e.g. RAM) that approximates a modern CPU. Such models allow us to report time and space complexity of algorithms. Now, with the spread out of <a href="http://en.wikipedia.org/wiki/GP...
complexity theory computer architecture power consumption machine models
1
Is there an abstract machine that can capture power consumption? -- (complexity theory computer architecture power consumption machine models) <p>When reporting algorithmic complexity of an algorithm, one assumes the underlying computations are performed on some abstract machine (e.g. RAM) that approximates a modern CP...
habedi/stack-exchange-dataset
273
Decidable non-context-sensitive languages
<p>It is arguable that most languages created to describe everyday problems are context-sensitives. In the other hand, it is possible and not hard to find some languages that are not recursive or even not recursively-enumerable.</p>&#xA;&#xA;<p>Between these two types are the recursive non-context-sensitive languages. ...
formal languages complexity theory formal grammars
1
Decidable non-context-sensitive languages -- (formal languages complexity theory formal grammars) <p>It is arguable that most languages created to describe everyday problems are context-sensitives. In the other hand, it is possible and not hard to find some languages that are not recursive or even not recursively-enume...
habedi/stack-exchange-dataset
285
Decidability of prefix language
<p>At the midterm there was a variant of the following question:</p>&#xA;&#xA;<blockquote>&#xA; <p>For a decidable $L$ define $$\text{Pref}(L) = \{ x \mid \exists y \text{ s.t. } xy \in L\}$$&#xA; Show that $\text{Pref}(L)$ is not necessarily decidable.</p>&#xA;</blockquote>&#xA;&#xA;<p>But if I choose $L=\Sigma^*$ ...
computability undecidability
1
Decidability of prefix language -- (computability undecidability) <p>At the midterm there was a variant of the following question:</p>&#xA;&#xA;<blockquote>&#xA; <p>For a decidable $L$ define $$\text{Pref}(L) = \{ x \mid \exists y \text{ s.t. } xy \in L\}$$&#xA; Show that $\text{Pref}(L)$ is not necessarily decidabl...
habedi/stack-exchange-dataset
286
Proving the security of Nisan-Wigderson pseudo-random number generator
<p>Let <span class="math-container">$\cal{S}=\{S_i\}_{1\leq i\leq n}$</span> be a partial <span class="math-container">$(m,k)$</span>-design and <span class="math-container">$f: \{0,1\}^m \to \{0,1\}$</span> be a Boolean function. The Nisan-Wigderson generator <span class="math-container">$G_f: \{0,1\}^l \to \{0,1\}^n$...
cryptography pseudo random generators
1
Proving the security of Nisan-Wigderson pseudo-random number generator -- (cryptography pseudo random generators) <p>Let <span class="math-container">$\cal{S}=\{S_i\}_{1\leq i\leq n}$</span> be a partial <span class="math-container">$(m,k)$</span>-design and <span class="math-container">$f: \{0,1\}^m \to \{0,1\}$</span...
habedi/stack-exchange-dataset
289
Universality of the Toffoli gate
<p>Regarding the quantum <a href="https://en.wikipedia.org/wiki/Toffoli_gate">Toffoli gate</a>:</p>&#xA;&#xA;<ol>&#xA;<li>is it <em>classicaly</em> universal, and if so, why?</li>&#xA;<li>is it <em>quantumly</em> universal, and why?</li>&#xA;</ol>&#xA;
quantum computing circuits turing completeness
1
Universality of the Toffoli gate -- (quantum computing circuits turing completeness) <p>Regarding the quantum <a href="https://en.wikipedia.org/wiki/Toffoli_gate">Toffoli gate</a>:</p>&#xA;&#xA;<ol>&#xA;<li>is it <em>classicaly</em> universal, and if so, why?</li>&#xA;<li>is it <em>quantumly</em> universal, and why?</l...
habedi/stack-exchange-dataset
302
ML function of type 'a -> 'b
<p>Our professor asked us to think of a function in OCaml that has the type</p>&#xA;&#xA;<pre><code>'a -&gt; 'b&#xA;</code></pre>&#xA;&#xA;<p>i.e. a function of one argument that could be anything, and that can return a different anything.</p>&#xA;&#xA;<p>I thought of using <code>raise</code> in a function that ignores...
programming languages typing functional programming
1
ML function of type 'a -> 'b -- (programming languages typing functional programming) <p>Our professor asked us to think of a function in OCaml that has the type</p>&#xA;&#xA;<pre><code>'a -&gt; 'b&#xA;</code></pre>&#xA;&#xA;<p>i.e. a function of one argument that could be anything, and that can return a different anyt...
habedi/stack-exchange-dataset
307
Show that { xy ∣ |x| = |y|, x ≠ y } is context-free
<p>I remember coming across the following question about a language that supposedly is context-free, but I was unable to find a proof of the fact. Have I perhaps misremembered the question?</p>&#xA;&#xA;<p>Anyway, here's the question:</p>&#xA;&#xA;<blockquote>&#xA; <p>Show that the language $L = \{xy \mid |x| = |y|, x...
formal languages context free
1
Show that { xy ∣ |x| = |y|, x ≠ y } is context-free -- (formal languages context free) <p>I remember coming across the following question about a language that supposedly is context-free, but I was unable to find a proof of the fact. Have I perhaps misremembered the question?</p>&#xA;&#xA;<p>Anyway, here's the question...
habedi/stack-exchange-dataset
310
Decision problem such that any algorithm admits an exponentially faster algorithm
<p>In Hromkovič's <a href="http://www.ite.ethz.ch/publications/buch/index_EN">Algorithmics for Hard Problems</a> (2nd edition) there is this theorem (2.3.3.3, page 117):</p>&#xA;&#xA;<blockquote>&#xA; <p>There is a (decidable) decision problem $P$ such that for every algorithm $A$ that solves $P$ there is another algo...
complexity theory
1
Decision problem such that any algorithm admits an exponentially faster algorithm -- (complexity theory) <p>In Hromkovič's <a href="http://www.ite.ethz.ch/publications/buch/index_EN">Algorithmics for Hard Problems</a> (2nd edition) there is this theorem (2.3.3.3, page 117):</p>&#xA;&#xA;<blockquote>&#xA; <p>There is a...
habedi/stack-exchange-dataset
311
Deriving the regular expression for C-style /**/ comments
<p>I'm working on a parser for a C-style language, and for that parser I need the regular expression that matches C-style /**/ comments. Now, I've found this expression on the web:</p>&#xA;&#xA;<pre><code>/\*([^\*]*\*+[^\*/])*([^\*]*\*+|[^\*]*\*/&#xA;</code></pre>&#xA;&#xA;<p>However, as you can see, this is a rather m...
compilers parsers regular languages
1
Deriving the regular expression for C-style /**/ comments -- (compilers parsers regular languages) <p>I'm working on a parser for a C-style language, and for that parser I need the regular expression that matches C-style /**/ comments. Now, I've found this expression on the web:</p>&#xA;&#xA;<pre><code>/\*([^\*]*\*+[^\...
habedi/stack-exchange-dataset
318
Are all system calls blocking?
<p>I was reading <a href="http://www.eecg.toronto.edu/~livio/papers/flexsc-osdi10.pdf">an article</a> that describes the switch between user-space and kernel-space that happens upon a system call. The article says </p>&#xA;&#xA;<blockquote>&#xA; <p>An application expects the completion of the system call before resumi...
operating systems os kernel
1
Are all system calls blocking? -- (operating systems os kernel) <p>I was reading <a href="http://www.eecg.toronto.edu/~livio/papers/flexsc-osdi10.pdf">an article</a> that describes the switch between user-space and kernel-space that happens upon a system call. The article says </p>&#xA;&#xA;<blockquote>&#xA; <p>An app...
habedi/stack-exchange-dataset
323
Which instruction yields atomicity in this expression that makes the result 2?
<p>I am reading about atomicity and came across the following scenario</p>&#xA;&#xA;<pre><code>int x = y = z = 0;&#xA;&#xA;Thread 1 Thread 2&#xA;--------- --------&#xA;x = y + z y = 1&#xA; z = 2&#xA;</code></pre>&#xA;&#xA;<p>Which gives the following sets of output</p>&#xA;&#xA;<p>$$\b...
operating systems programming languages concurrency
1
Which instruction yields atomicity in this expression that makes the result 2? -- (operating systems programming languages concurrency) <p>I am reading about atomicity and came across the following scenario</p>&#xA;&#xA;<pre><code>int x = y = z = 0;&#xA;&#xA;Thread 1 Thread 2&#xA;--------- --------&#xA;x =...
habedi/stack-exchange-dataset
326
Distinguishing between uppercase and lowercase letters in the "move-to-front" method
<p>Is it not necessary to encode both the uppercase and lowercase letter while encoding a message with the <a href="http://en.wikipedia.org/wiki/Move-to-front_transform" rel="nofollow">move-to-front transform</a>? From an old computer science course exam, the problem was to encode <code>Matt_ate_the_mat</code> starting...
combinatorics data compression
1
Distinguishing between uppercase and lowercase letters in the "move-to-front" method -- (combinatorics data compression) <p>Is it not necessary to encode both the uppercase and lowercase letter while encoding a message with the <a href="http://en.wikipedia.org/wiki/Move-to-front_transform" rel="nofollow">move-to-front ...
habedi/stack-exchange-dataset
329
Do you get DFS if you change the queue to a stack in a BFS implementation?
<p>Here is the standard pseudocode for breadth first search:</p>&#xA;&#xA;<pre><code>{ seen(x) is false for all x at this point }&#xA;push(q, x0)&#xA;seen(x0) := true&#xA;while (!empty(q))&#xA; x := pop(q)&#xA; visit(x)&#xA; for each y reachable from x by one edge&#xA; if not seen(y)&#xA; push(q, y)&#xA; ...
algorithms graphs
1
Do you get DFS if you change the queue to a stack in a BFS implementation? -- (algorithms graphs) <p>Here is the standard pseudocode for breadth first search:</p>&#xA;&#xA;<pre><code>{ seen(x) is false for all x at this point }&#xA;push(q, x0)&#xA;seen(x0) := true&#xA;while (!empty(q))&#xA; x := pop(q)&#xA; visit(x)&...
habedi/stack-exchange-dataset
332
In-place algorithm for interleaving an array
<p>You are given an array of $2n$ elements </p>&#xA;&#xA;<p>$$a_1, a_2, \dots, a_n, b_1, b_2, \dots b_n$$</p>&#xA;&#xA;<p>The task is to interleave the array, using an in-place algorithm such that the resulting array looks like</p>&#xA;&#xA;<p>$$b_1, a_1, b_2, a_2, \dots , b_n, a_n$$</p>&#xA;&#xA;<p>If the in-place req...
algorithms arrays permutations in place
1
In-place algorithm for interleaving an array -- (algorithms arrays permutations in place) <p>You are given an array of $2n$ elements </p>&#xA;&#xA;<p>$$a_1, a_2, \dots, a_n, b_1, b_2, \dots b_n$$</p>&#xA;&#xA;<p>The task is to interleave the array, using an in-place algorithm such that the resulting array looks like</p...
habedi/stack-exchange-dataset
335
What is the height of an empty BST when using it in context for balancing?
<p>Suppose the datatype for a BST is defined as follows (in SML)</p>&#xA;<pre><code>datatype 'a bst_Tree =&#xA; Empty&#xA; | Node of (int * 'a) * 'a bst_Tree * 'a bst_Tree;&#xA;</code></pre>&#xA;<p>So there are two cases one in which the BST is <code>Empty</code> or it can have a (key,value) as well as two children.<...
algorithms data structures terminology
1
What is the height of an empty BST when using it in context for balancing? -- (algorithms data structures terminology) <p>Suppose the datatype for a BST is defined as follows (in SML)</p>&#xA;<pre><code>datatype 'a bst_Tree =&#xA; Empty&#xA; | Node of (int * 'a) * 'a bst_Tree * 'a bst_Tree;&#xA;</code></pre>&#xA;<p>S...
habedi/stack-exchange-dataset
341
ML functions from polymorphic lists to polymorphic lists
<p>I'm learning programming in ML (OCaml), and earlier I asked about <a href="https://cs.stackexchange.com/questions/302/ml-function-of-type-a-b">ML functions of type <code>'a -&gt; 'b</code></a>. Now I've been experimenting a bit with functions of type <code>'a list -&gt; 'b list</code>. There are some obvious simple ...
programming languages typing functional programming
1
ML functions from polymorphic lists to polymorphic lists -- (programming languages typing functional programming) <p>I'm learning programming in ML (OCaml), and earlier I asked about <a href="https://cs.stackexchange.com/questions/302/ml-function-of-type-a-b">ML functions of type <code>'a -&gt; 'b</code></a>. Now I've ...
habedi/stack-exchange-dataset
342
Not all Red-Black trees are balanced?
<p>Intuitively, &quot;balanced trees&quot; should be trees where left and right sub-trees at each node must have &quot;approximately the same&quot; number of nodes.</p>&#xA;<p>Of course, when we talk about red-black trees*(see definition at the end) being balanced, we actually mean that they are <em>height</em> balance...
data structures binary trees search trees
1
Not all Red-Black trees are balanced? -- (data structures binary trees search trees) <p>Intuitively, &quot;balanced trees&quot; should be trees where left and right sub-trees at each node must have &quot;approximately the same&quot; number of nodes.</p>&#xA;<p>Of course, when we talk about red-black trees*(see definiti...
habedi/stack-exchange-dataset
349
Why is encrypting with the same one-time-pad not good?
<p>To encrypt a message $m_1$ with a one-time-pad key $k$ you do&#xA;$Enc(m_1,k) = m_1 \oplus k$. </p>&#xA;&#xA;<p>If you use the same $k$ to encrypt a different message $m_2$ you get&#xA;$Enc(m_2,k) = m_2 \oplus k$, and if you perform Xor of the two ciphertext you get&#xA;$$( m_1 \oplus k) \oplus ( m_2 \oplus k) = m_1...
cryptography information theory encryption
1
Why is encrypting with the same one-time-pad not good? -- (cryptography information theory encryption) <p>To encrypt a message $m_1$ with a one-time-pad key $k$ you do&#xA;$Enc(m_1,k) = m_1 \oplus k$. </p>&#xA;&#xA;<p>If you use the same $k$ to encrypt a different message $m_2$ you get&#xA;$Enc(m_2,k) = m_2 \oplus k$, ...
habedi/stack-exchange-dataset
350
What is an intuitive way to explain and understand De Morgan's Law?
<p>De Morgan's Law is often introduced in an introductory mathematics for computer science course, and I often see it as a way to turn statements from AND to OR by negating terms.</p>&#xA;&#xA;<p>Is there a more intuitive explanation for why this works rather than just remembering truth tables? To me this is like using...
logic discrete mathematics didactics
1
What is an intuitive way to explain and understand De Morgan's Law? -- (logic discrete mathematics didactics) <p>De Morgan's Law is often introduced in an introductory mathematics for computer science course, and I often see it as a way to turn statements from AND to OR by negating terms.</p>&#xA;&#xA;<p>Is there a mor...
habedi/stack-exchange-dataset
356
Why hasn't there been an encryption algorithm that is based on the known NP-Hard problems?
<p>Most of today's encryption, such as the RSA, relies on the integer factorization, which is not believed to be a NP-hard problem, but it belongs to BQP, which makes it vulnerable to quantum computers. I wonder, why has there not been an encryption algorithm which is based on an known NP-hard problem. It sounds (at le...
complexity theory np hard encryption cryptography
1
Why hasn't there been an encryption algorithm that is based on the known NP-Hard problems? -- (complexity theory np hard encryption cryptography) <p>Most of today's encryption, such as the RSA, relies on the integer factorization, which is not believed to be a NP-hard problem, but it belongs to BQP, which makes it vuln...
habedi/stack-exchange-dataset
358
How to verify number with Bob without Eve knowing?
<p>You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the messa...
algorithms cryptography
1
How to verify number with Bob without Eve knowing? -- (algorithms cryptography) <p>You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must...
habedi/stack-exchange-dataset
366
What goes wrong with sums of Landau terms?
<p>I wrote</p>&#xA;&#xA;<p>$\qquad \displaystyle \sum\limits_{i=1}^n \frac{1}{i} = \sum\limits_{i=1}^n \cal{O}(1) = \cal{O}(n)$</p>&#xA;&#xA;<p>but my friend says this is wrong. From the TCS cheat sheet I know that the sum is also called $H_n$ which has logarithmic growth in $n$. So my bound is not very sharp, but is s...
asymptotics landau notation
1
What goes wrong with sums of Landau terms? -- (asymptotics landau notation) <p>I wrote</p>&#xA;&#xA;<p>$\qquad \displaystyle \sum\limits_{i=1}^n \frac{1}{i} = \sum\limits_{i=1}^n \cal{O}(1) = \cal{O}(n)$</p>&#xA;&#xA;<p>but my friend says this is wrong. From the TCS cheat sheet I know that the sum is also called $H_n$ ...
habedi/stack-exchange-dataset
367
How can it be decidable whether $\pi$ has some sequence of digits?
<p>We were given the following exercise.</p>&#xA;&#xA;<blockquote>&#xA; <p>Let</p>&#xA; &#xA; <p>$\qquad \displaystyle f(n) = \begin{cases} 1 &amp; 0^n \text{ occurs in the decimal representation of } \pi \\ 0 &amp; \text{else}\end{cases}$</p>&#xA; &#xA; <p>Prove that $f$ is computable.</p>&#xA;</blockquote>&#xA;&...
computability undecidability
1
How can it be decidable whether $\pi$ has some sequence of digits? -- (computability undecidability) <p>We were given the following exercise.</p>&#xA;&#xA;<blockquote>&#xA; <p>Let</p>&#xA; &#xA; <p>$\qquad \displaystyle f(n) = \begin{cases} 1 &amp; 0^n \text{ occurs in the decimal representation of } \pi \\ 0 &amp; ...
habedi/stack-exchange-dataset
368
Counting binary trees
<p>(I'm a student with some mathematical background and I'd like to know how to count the number of a specific kind of binary trees.)</p>&#xA;&#xA;<p>Looking at Wikipedia page for <a href="http://en.wikipedia.org/wiki/Binary_tree">Binary Trees</a>, I've noticed this assertion that the number of rooted binary trees of s...
combinatorics binary trees discrete mathematics
1
Counting binary trees -- (combinatorics binary trees discrete mathematics) <p>(I'm a student with some mathematical background and I'd like to know how to count the number of a specific kind of binary trees.)</p>&#xA;&#xA;<p>Looking at Wikipedia page for <a href="http://en.wikipedia.org/wiki/Binary_tree">Binary Trees</...
habedi/stack-exchange-dataset
374
Languages accepted by modified versions of finite automata
<p>A deterministic finite automaton (DFA) is a state machine model capable of accepting all and only regular languages. DFAs can be (and usually are) defined in such a way that each state must provide some transition for all elements of the input alphabet; in other words, the transition function $\delta : Q \times \Sig...
formal languages automata finite automata
1
Languages accepted by modified versions of finite automata -- (formal languages automata finite automata) <p>A deterministic finite automaton (DFA) is a state machine model capable of accepting all and only regular languages. DFAs can be (and usually are) defined in such a way that each state must provide some transiti...
habedi/stack-exchange-dataset
376
Is this language defined using twin primes regular?
<p>Let</p>&#xA;&#xA;<p>$\qquad L = \{a^n \mid \exists_{p \geq n}\ p\,,\ p+2 \text{ are prime}\}.$</p>&#xA;&#xA;<p>Is $L$ regular?</p>&#xA;&#xA;<p>This question looked suspicious at the first glance and I've realized that it is connected with the <a href="https://en.wikipedia.org/wiki/Twin_prime">twin prime conjecture</...
formal languages automata regular languages finite automata
1
Is this language defined using twin primes regular? -- (formal languages automata regular languages finite automata) <p>Let</p>&#xA;&#xA;<p>$\qquad L = \{a^n \mid \exists_{p \geq n}\ p\,,\ p+2 \text{ are prime}\}.$</p>&#xA;&#xA;<p>Is $L$ regular?</p>&#xA;&#xA;<p>This question looked suspicious at the first glance and I...
habedi/stack-exchange-dataset
393
Proving closure under complementation of languages accepted by min-heap automata
<p><em>This is a follow-up question of <a href="https://cs.stackexchange.com/q/110/98">this one</a></em>.</p>&#xA;&#xA;<p>In a previous question about <a href="https://cs.stackexchange.com/q/110/69">exotic state machines</a>, Alex ten Brink and Raphael addressed the computational capabilities of a peculiar kind of stat...
formal languages automata closure properties
1
Proving closure under complementation of languages accepted by min-heap automata -- (formal languages automata closure properties) <p><em>This is a follow-up question of <a href="https://cs.stackexchange.com/q/110/98">this one</a></em>.</p>&#xA;&#xA;<p>In a previous question about <a href="https://cs.stackexchange.com/...
habedi/stack-exchange-dataset
394
Computational power of deterministic versus nondeterministic min-heap automata
<p><em>This is a follow-up question of <a href="https://cs.stackexchange.com/q/110/98">this one</a>.</em></p>&#xA;&#xA;<p>In a previous question about <a href="https://cs.stackexchange.com/q/110/69">exotic state machines</a>, Alex ten Brink and Raphael addressed the computational capabilities of a peculiar kind of stat...
formal languages automata nondeterminism
1
Computational power of deterministic versus nondeterministic min-heap automata -- (formal languages automata nondeterminism) <p><em>This is a follow-up question of <a href="https://cs.stackexchange.com/q/110/98">this one</a>.</em></p>&#xA;&#xA;<p>In a previous question about <a href="https://cs.stackexchange.com/q/110/...
habedi/stack-exchange-dataset
396
A DFA for recognizing comments
<p>The following DFA is a lexical analyzer which is supposed to recognize comments. The lexical analyzer will ignore the comment and goes back to the state one. I'm told that there's something wrong with it but I can't figure it out. What's the problem?</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/EeIdO.png" alt...
formal languages automata finite automata compilers
1
A DFA for recognizing comments -- (formal languages automata finite automata compilers) <p>The following DFA is a lexical analyzer which is supposed to recognize comments. The lexical analyzer will ignore the comment and goes back to the state one. I'm told that there's something wrong with it but I can't figure it out...
habedi/stack-exchange-dataset
407
Measuring the difficulty of SAT instances
<p>Given an instance of SAT, I would like to be able to estimate how difficult it will be to solve the instance.</p>&#xA;<p>One way is to run existing solvers, but that kind of defeats the purpose of estimating difficulty. A second way might be looking a the ratio of clauses to variables, as is done for phase transitio...
complexity theory satisfiability heuristics
1
Measuring the difficulty of SAT instances -- (complexity theory satisfiability heuristics) <p>Given an instance of SAT, I would like to be able to estimate how difficult it will be to solve the instance.</p>&#xA;<p>One way is to run existing solvers, but that kind of defeats the purpose of estimating difficulty. A seco...
habedi/stack-exchange-dataset
411
How to find a superstar in linear time?
<p>Consider directed graphs. We call a node $v$ <em>superstar</em> if and only if no other node can be reached from it, but all other nodes have an edge to $v$. Formally:</p>&#xA;&#xA;<p>$\qquad \displaystyle $v$ \text{ superstar } :\Longleftrightarrow \mathrm{outdeg}(v) = 0 \land \mathrm{indeg}(v) = n-1$</p>&#xA;&#xA;...
algorithms graphs
1
How to find a superstar in linear time? -- (algorithms graphs) <p>Consider directed graphs. We call a node $v$ <em>superstar</em> if and only if no other node can be reached from it, but all other nodes have an edge to $v$. Formally:</p>&#xA;&#xA;<p>$\qquad \displaystyle $v$ \text{ superstar } :\Longleftrightarrow \mat...
habedi/stack-exchange-dataset
416
Approximation of minimum bandwidth on binary trees
<p>Minimum bandwidth problem is to a find an ordering of graph nodes on integer line that minimizes the largest distance between any two adjacent nodes. </p>&#xA;&#xA;<p>The decision problem is NP-complete even for binary trees. <a href="http://www.jstor.org/stable/10.2307/2100947">Complexity Results for Bandwidth Mini...
complexity theory np complete reference request approximation
1
Approximation of minimum bandwidth on binary trees -- (complexity theory np complete reference request approximation) <p>Minimum bandwidth problem is to a find an ordering of graph nodes on integer line that minimizes the largest distance between any two adjacent nodes. </p>&#xA;&#xA;<p>The decision problem is NP-compl...
habedi/stack-exchange-dataset
419
Is there any concrete relation between Gödel's incompleteness theorem, the halting problem and universal Turing machines?
<p>I've always thought vaguely that the answer to the above question was affirmative along the following lines. Gödel's incompleteness theorem and the undecidability of the halting problem both being negative results about decidability and established by diagonal arguments (and in the 1930's), so they must somehow be t...
computability logic halting problem incompleteness
1
Is there any concrete relation between Gödel's incompleteness theorem, the halting problem and universal Turing machines? -- (computability logic halting problem incompleteness) <p>I've always thought vaguely that the answer to the above question was affirmative along the following lines. Gödel's incompleteness theorem...
habedi/stack-exchange-dataset
421
AVL trees are not weight-balanced?
<p>In a previous <a href="https://cs.stackexchange.com/questions/342/not-all-red-black-trees-are-balanced">question</a> there was a definition of weight balanced trees and a question regarding red-black trees. </p>&#xA;&#xA;<p>This question is to ask the same question, but for <a href="http://en.wikipedia.org/wiki/AVL_...
data structures binary trees search trees balanced search trees avl trees
1
AVL trees are not weight-balanced? -- (data structures binary trees search trees balanced search trees avl trees) <p>In a previous <a href="https://cs.stackexchange.com/questions/342/not-all-red-black-trees-are-balanced">question</a> there was a definition of weight balanced trees and a question regarding red-black tre...
habedi/stack-exchange-dataset
423
How hard is counting the number of simple paths between two nodes in a directed graph?
<p>There is an easy polynomial algorithm to decide whether there is a path between two nodes in a directed graph (just do a routine graph traversal with, say, depth-first-search).</p>&#xA;&#xA;<p>However it seems that, surprisingly, the problem gets much harder if instead of testing for the existence we want want to <e...
algorithms complexity theory graphs
1
How hard is counting the number of simple paths between two nodes in a directed graph? -- (algorithms complexity theory graphs) <p>There is an easy polynomial algorithm to decide whether there is a path between two nodes in a directed graph (just do a routine graph traversal with, say, depth-first-search).</p>&#xA;&#xA...
habedi/stack-exchange-dataset
430
Easy to state open problems in computability theory
<p>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...
computability
1
Easy to state open problems in computability theory -- (computability) <p>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...
habedi/stack-exchange-dataset
431
Break an authentication protocol based on a pre-shared symmetric key
<p>Consider the following protocol, meant to authenticate $A$ (Alice) to $B$ (Bob) and vice versa.</p>&#xA;&#xA;<p>$$ \begin{align*}&#xD;&#xA; A \to B: &amp;\quad \text{“I&#39;m Alice”}, R_A \\&#xD;&#xA; B \to A: &amp;\quad E(R_A, K) \\&#xD;&#xA; A \to B: &amp;\quad E(\langle R_A+1, P_A\rangle, K) \\&#xD;&#xA;\end{alig...
cryptography protocols authentication
1
Break an authentication protocol based on a pre-shared symmetric key -- (cryptography protocols authentication) <p>Consider the following protocol, meant to authenticate $A$ (Alice) to $B$ (Bob) and vice versa.</p>&#xA;&#xA;<p>$$ \begin{align*}&#xD;&#xA; A \to B: &amp;\quad \text{“I&#39;m Alice”}, R_A \\&#xD;&#xA; B \t...
habedi/stack-exchange-dataset
433
Is it possible to derive a string in this rewriting system?
<p>Rewriting system is a set of rules in the form of $A \leftrightarrow B$. &#xA;If we apply that rule to a string $w$ we replace any substring $A$ in $w$ with a substring $B$ and vice versa.</p>&#xA;&#xA;<p>Given a starting string $AAABB$ can we derive $BAAB$ in the system with the following rules:</p>&#xA;&#xA;<ul>&...
computability term rewriting
1
Is it possible to derive a string in this rewriting system? -- (computability term rewriting) <p>Rewriting system is a set of rules in the form of $A \leftrightarrow B$. &#xA;If we apply that rule to a string $w$ we replace any substring $A$ in $w$ with a substring $B$ and vice versa.</p>&#xA;&#xA;<p>Given a starting ...
habedi/stack-exchange-dataset
438
Is interaction more powerful than algorithms?
<p>I've heard the motto <a href="http://www.cs.brown.edu/people/pw/papers/ficacm.ps"><strong>interaction is more powerful than algorithms</strong></a> from <a href="http://www.cs.brown.edu/~pw/">Peter Wegner</a>. The basis of the idea is that a (classical) Turing Machine cannot handle interaction, that is, communicatio...
computability computation models
1
Is interaction more powerful than algorithms? -- (computability computation models) <p>I've heard the motto <a href="http://www.cs.brown.edu/people/pw/papers/ficacm.ps"><strong>interaction is more powerful than algorithms</strong></a> from <a href="http://www.cs.brown.edu/~pw/">Peter Wegner</a>. The basis of the idea i...
habedi/stack-exchange-dataset
439
Which combinations of pre-, post- and in-order sequentialisation are unique?
<p>We know post-order,</p>&#xA;&#xA;<pre><code>post L(x) =&gt; [x]&#xA;post N(x,l,r) =&gt; (post l) ++ (post r) ++ [x]&#xA;</code></pre>&#xA;&#xA;<p>and pre-order</p>&#xA;&#xA;<pre><code>pre L(x) =&gt; [x]&#xA;pre N(x,l,r) =&gt; [x] ++ (pre l) ++ (pre r)&#xA;</code></pre>&#xA;&#xA;<p>and in-order traversal resp...
algorithms binary trees
1
Which combinations of pre-, post- and in-order sequentialisation are unique? -- (algorithms binary trees) <p>We know post-order,</p>&#xA;&#xA;<pre><code>post L(x) =&gt; [x]&#xA;post N(x,l,r) =&gt; (post l) ++ (post r) ++ [x]&#xA;</code></pre>&#xA;&#xA;<p>and pre-order</p>&#xA;&#xA;<pre><code>pre L(x) =&gt; [x]&...
habedi/stack-exchange-dataset
443
termination of two concurrent threads with shared variables
<p>We're in a shared memory concurrency model where all reads and writes to integer variables are atomic. </p>&#xA;&#xA;<ul>&#xA;<li><code>do:</code> $S_1$ <code>in parallel with:</code> $S_2$&#160;  means to execute $S_1$ and $S_2$ in separate threads, concurrently.</li>&#xA;<li><code>atomically(</code>$E$<code>)</co...
concurrency shared memory imperative programming
1
termination of two concurrent threads with shared variables -- (concurrency shared memory imperative programming) <p>We're in a shared memory concurrency model where all reads and writes to integer variables are atomic. </p>&#xA;&#xA;<ul>&#xA;<li><code>do:</code> $S_1$ <code>in parallel with:</code> $S_2$&#160;  means...
habedi/stack-exchange-dataset
444
CCS process for a drink dispenser with two different prices
<p>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 <a href="ht...
logic concurrency modelling process algebras ccs
1
CCS process for a drink dispenser with two different prices -- (logic concurrency modelling process algebras ccs) <p>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 r...
habedi/stack-exchange-dataset
450
Ray Tracing versus object-based rendering?
<p>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. </p>&#xA;&#xA;<p>Is ray tracing really the <em>bes...
graphics
1
Ray Tracing versus object-based rendering? -- (graphics) <p>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 SIGGRAP...
habedi/stack-exchange-dataset
451
Why are there so many programming languages?
<p>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.</p>&#xA;&#xA;<p>But why are there so many different programming languages ?...
programming languages
1
Why are there so many programming languages? -- (programming languages) <p>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.</p>...
habedi/stack-exchange-dataset
470
How is the key in a private key encryption protocol exchanged?
<p>Windows NT used a point-to-point protocol where a client can communicate "securely" with a server by using a stream cipher to encrypt an array of messages with some key $k$. The server also encrypts its response with the same key $k$. But how is it aware of this key?</p>&#xA;&#xA;<p>More general: if Alice and Bob us...
cryptography encryption
1
How is the key in a private key encryption protocol exchanged? -- (cryptography encryption) <p>Windows NT used a point-to-point protocol where a client can communicate "securely" with a server by using a stream cipher to encrypt an array of messages with some key $k$. The server also encrypts its response with the same...
habedi/stack-exchange-dataset
473
Decision problems vs "real" problems that aren't yes-or-no
<p>I read in many places that some problems are difficult to approximate (it is <a href="https://en.wikipedia.org/wiki/Hardness_of_approximation" rel="noreferrer"><strong>NP-hard</strong> to approximate</a> them). But approximation is not a decision problem: the answer is a real number and not Yes or No. Also for eac...
complexity theory time complexity np hard approximation
1
Decision problems vs "real" problems that aren't yes-or-no -- (complexity theory time complexity np hard approximation) <p>I read in many places that some problems are difficult to approximate (it is <a href="https://en.wikipedia.org/wiki/Hardness_of_approximation" rel="noreferrer"><strong>NP-hard</strong> to approxim...
habedi/stack-exchange-dataset
477
For what kind of data are hash table operations O(1)?
<p>From the answers to <a href="https://cs.stackexchange.com/questions/249/when-is-hash-table-lookup-o1">(When) is hash table lookup O(1)?</a>, I gather that hash tables have $O(1)$ worst-case behavior, at least amortized, when the data satisfies certain statistical conditions, and there are techniques to help make the...
data structures runtime analysis hash tables dictionaries
1
For what kind of data are hash table operations O(1)? -- (data structures runtime analysis hash tables dictionaries) <p>From the answers to <a href="https://cs.stackexchange.com/questions/249/when-is-hash-table-lookup-o1">(When) is hash table lookup O(1)?</a>, I gather that hash tables have $O(1)$ worst-case behavior, ...
habedi/stack-exchange-dataset
481
Break an authentication protocol based on a pre-shared symmetric key, with message numbers
<p>Consider the following protocol, meant to authenticate $A$ (Alice) to $B$ (Bob) and vice versa.</p>&#xA;&#xA;<p>$$ \begin{align*}&#xA; A \to B: &amp;\quad \text{“I'm Alice”}, R_A \\&#xA; B \to A: &amp;\quad E(\langle 1, R_A\rangle, K) \\&#xA; A \to B: &amp;\quad E(\langle 2, R_A+1, P_A\rangle, K) \\&#xA;\end{align*}...
cryptography protocols authentication
1
Break an authentication protocol based on a pre-shared symmetric key, with message numbers -- (cryptography protocols authentication) <p>Consider the following protocol, meant to authenticate $A$ (Alice) to $B$ (Bob) and vice versa.</p>&#xA;&#xA;<p>$$ \begin{align*}&#xA; A \to B: &amp;\quad \text{“I'm Alice”}, R_A \\&#...
habedi/stack-exchange-dataset