Problem Detail: In proving Parikh’s Theorem, my Theory of Computer Science textbook defines a linear set as: $u_0 + langle u_1, dots, u_m rangle = {u_0 + a_1u_1 + dots + a_mu_m mid a_1, dots, a_m in mathbb{N}}$ where $u_i$ are Read More …
Category: Uncategorized
[Solved]: Broken stick problem
Problem Detail: We have a broken stick. For every part, we know it’s length. Our task is to connect all parts (glue them), that we will use as small amount of glue as possible. The amount of glue need to connect Read More …
[Solved]: Is it $mathsf{NP}$-hard to decide whether $mathsf{P}=mathsf{NP}$?
Problem Detail: Is it $mathsf{NP}$-hard to decide whether $mathsf{P}=mathsf{NP}$ ? If so, what are the implications ? Is there result suggesting that it is the case ? Asked By : eig Answered By : Mike B. A similar question is this: Is Read More …
[Solved]: Number of Final States Subset Construction for NFA to DFA
Problem Detail: “Suppose we use the subset construction to convert a $7$-state NFA $M = (Q,Sigma, delta, q_0, F)$ into a DFA $M’ = (Q’, Sigma, delta’, q_0, F’)$ for the same language. Then $M’$ will have $|Q’| = 128$ states. Read More …
[Solved]: Integer Knapsack Problem – No duplicates Allowed
Problem Detail: In the bounded Integer Knapsack problem, we are given N items of sizes S1 through SN, having values V1 through VN. The problem requires us to find the maximum value that can be attained for a given capacity C, Read More …
[Solved]: Building static hash table with particular collisions
Problem Detail: Is there efficient algorithm to encode keys in hash function with provided collisions? By efficient I mean with low-ish runtime of lookup operation (taking constants into account) and realistic time of finding such function. Keys are floating point Read More …
[Solved]: Not understand exchanging argument proof for optimal prefix code
Problem Detail: I am currently reading the Algorithm Design textbook by Kleinberg and Tardos and I am having difficulty understanding a proof using an exchange argument Statement: A binary tree corresponding to the optimal prefix code is full Proof: This is Read More …
[Solved]: Why multiple return values is not a common thing?
Problem Detail: I would like to ask a question about multiple return values, why this construct is not preferrable in programming languages (conceptual and/or technical difficulties). I’ve heard something about stack frames and how they reserve memory for return value and Read More …
[Solved]: How many edges can a unipathic graph have?
Problem Detail: A unipathic graph is a directed graph such that there is at most one simple path from any one vertex to any other vertex. Unipathic graphs can have cycles. For example, a doubly linked list (not a circular one!) Read More …
[Solved]: Scala as a language for Generic Programming
Problem Detail: I posted the same Q at programmers.SE, but nobody really helps. In the paper “An Extended Comparative Study of Language Support for Generic Programming” by Garcia et al. an interesting comparison of programming languages features for generic programming is Read More …