Problem Detail: This grammar is supposed to give priority to multiplication: E -> E + T | T. T -> T * F | F. F -> x. A derivation for “x + x * x” would be (unless I’m wrong): Read More …
Category: Uncategorized
[Solved]: Can parameters be contra- or covariant in Python?
Problem Detail: I’ve just now studied about covariance and contravariance in static languages (more specifically C#). This concept is rather clear to me, however I’m in doubt on how this applies to dynamic languages like Python. Since Python is duck typed Read More …
[Solved]: Complexity of edit distance with block operations
Problem Detail: Consider the following problem. I have a pattern $P$ of length $100$ and a text $T$ of length $n$. I want to find the minimum number of operations to transform $P$ into $T$. The operations are: Insert a single Read More …
[Solved]: Variable Length Encoding of Integers Using a Modulus Algorithm
Problem Detail: Continuing on the theme from my last question Variable Length Encoding of Integers, I have come up with a simple encoding scheme, but for which an efficient algorithm eludes me. The constraints are simple enough: no (binary representation) number Read More …
[Solved]: Meaning of empty clause
Problem Detail: Why does the empty clause is logically equivalent to a contraddiction: $square cup square Longleftrightarrow perp$ and why the empty cube is logically equivalent to a tautology: $square cap square Longleftrightarrow top$ ? Asked By : alessandro Answered By : zarathustra Read More …
[Solved]: A hash function with predicted collisions
Problem Detail: As far as I know, the more collision-resistant a hash function is, the better. But is there any way to define a hash function with predicted collisions? In other words, a hash function that collides for some known set Read More …
[Solved]: Is $L_p$ decidable when p is a trivial property?
Problem Detail: If $qquaddisplaystyle L_p = { langle M rangle : p in P(L(M)) text{ s.t. } p text{ is a specific trivial property} }$, where a trivial property is a property that is shared by all recursively enumerable languages or Read More …
[Solved]: Binary rooted tree isomorphism
Problem Detail: My trees are rooted and have at most two children at every vertex. I need references that help me solve any or all of the questions below: How many isomorphism classes of trees with n vertices are there? What Read More …
[Solved]: Quantifiers in lambda calculus
Problem Detail: I’m learning lambda calculus, however I’m quite confused about the quantifiers in lambda calculus. As far as I know, quantifiers such as “∃” are concepts of first order logic (FOL), which are not needed by lambda calculus. Moreover, I Read More …
[Solved]: Why are pushdown automata countable?
Problem Detail: I began a chapter in a textbook on computational theory where they begin to talk about decidable languages. The problems in this section are pretty confusing and I honestly don’t know how to begin them because I’m not 100% Read More …