Problem Detail: My competitive programming coach told me of a balanced binary tree used by a lot of Chinese competitors that has all the functions of any other balanced binary tree and is fully persistent and runs queries and updates in Read More …
Category: Uncategorized
[Solved]: Turing Machines: Arbitrary alphabet equivalence with binary alphabet
Problem Detail: Think of an $n$-ary alphabet as ${0, 1, …, n-1, n}$. For example, a binary alphabet is ${0, 1}$. Do Turing Machines with binary alphabets decide the same set of languages as Turing Machines with $3$+ symbol alphabets? I Read More …
[Solved]: Pseudo-random sequence prediction
Problem Detail: Disclaimer: I am a biologist, so sorry for (perhaps) basic question phrased in such crude terms. I am not sure if I should ask this question here or on DS/SC, but CS is the largest of three, so Read More …
[Solved]: Is a language with only a stack of fixed-size integers Turing-complete?
Problem Detail: I encountered the brainfuck programming language which I know is turing complete. However I then decided to create a high level language that gets compiled to brainfuck code. There is only one data type in it (integer, since that’s Read More …
[Solved]: Running time of selection sort
Problem Detail: I wrote pseudocode for Selection Sort, but I’m not sure what is the running time of my algorithm, can you help me with that? My Pseudocode: Selection Sort(int a[], int n) Input: array of length $n$ Output: sorted array Read More …
[Solved]: How do I find the shortest representation for a subset of a powerset?
Problem Detail: I’m looking for an efficient algorithm for the following problem or a proof of NP-hardness. Let $Sigma$ be a set and $Asubseteqmathcal{P}(Sigma)$ a set of subsets of $Sigma$. Find a sequence $win Sigma^*$ of least length such that for Read More …
[Solved]: Represent string as concatenations
Problem Detail: If $S_1,S_2$ are set of strings, then $S_1S_2 = {s_1s_2|s_1in S_1, s_2in S_2}$. $S^0={epsilon}$, $epsilon$ is the empty string. $S^n = S^{n-1}S$. Two related problems about represent string as concatenation of other strings. Given a finite set $S$ of Read More …
[Solved]: Known bounds on space complexity of multiplication decision problem
Problem Detail: Given three numbers $m$, $n$ and $p$ in interleaved binary encoding1, it’s obviously possible to check in $O(1)$ space whether $m+n=p$. It’s less obvious2 that it isn’t possible to check in $O(1)$ space whether $mcdot n=p$. I wonder whether Read More …
[Solved]: Finding all marked elements using Grover’s algorithm
Problem Detail: Grover’s algorithm uses an oracle function $f(x) to {0,1}$ to find the location of a single marked element from an unordered database of $2^n$ elements with high probability. As part of an assignment I am supposed to design a Read More …
[Solved]: Solving a complicated recurrence relation
Problem Detail: How to solve the recurrence relation below? $$T(n) = begin{cases} 2T(sqrt{n}) + log n/loglog n & text{if } n > 4 1 & text{if } n leq 4. end{cases}$$ Preferably by the master theorem; otherwise by any method. I Read More …