Problem Detail: In practice I understand that any recursion can be written as a loop (and vice versa(?)) and if we measure with actual computers we find that loops are faster than recursion for the same problem. But is there any Read More …
Month: January 2017
[Solved]: Carry-free multiplication operation
Problem Detail: In long-multiplication, you shift and add, once for each $1$ bit in the lower number. Let $r = p otimes q$ be an operation similar to multiplication, but slightly simpler: when expressed via long-multiplication, the addition does not carry. Read More …
[Solved]: shortest cost tiling of path to x distance
Problem Detail: I have a distance to get to, and square tiles that have a cost and length. EX: a 1 unit block that costs 1 unit to purchase. So if I was trying to get 10 units away. I would Read More …
[Solved]: Universal simulation of Turing machines
Problem Detail: Let $f$ be a fixed time-constructable function. The classical universal simulation result for TMs (Hennie and Stearns, 1966) states that there is a two-tape TM $U$ such that given the description of a TM $langle M rangle$, and an Read More …
[Solved]: What is an “encoding” of a TM?
Problem Detail: I’m currently working on a reduction from $A_{TM}$ to another language, and have been reading through some example proofs. I’ve come across the situation where, for example, we have $L = { langle M,w rangle | text{ …etc} }$, Read More …
[Solved]: How to efficiently use an AVL tree to store partial sums?
Problem Detail: Let $a_{1} , … , a_{m} $ be real numbers $geq 1$, where $m$ is at least 1. I am supposed to store them in an augmented AVL structure with the following operations: -PartialSum (i): Return the $i_{th}$ partial Read More …
[Solved]: Does this DFA have a solution?
Problem Detail: I am trying to create a DFA that can recognize strings with alphabet ${a,b,c}$ where $a$ and $c$ appear even number of times and where $b$ appears odd number of times. I am wondering that this may only be Read More …
[Solved]: When are 2 decision/optimization problems equivalent?
Problem Detail: Does anybody know a good definition of 2 decision / optimization problems being equivalent? I am asking since for example allowing polynomial time computations any 2 problems in NP could be considered equivalent. Asked By : Reb Answered By : Yuval Read More …
[Solved]: Algorithm to find a line that divides the number of points equally
Problem Detail: I have recently been asked in an interview to devise an algorithm that divides a set of points in a coordinate system so that half of the points lie on one side of the line, and the rest on Read More …
[Solved]: Why is deciding regularity of a context-free language undecidable?
Problem Detail: As I have studied, deciding regularity of context-free languages is undecidable. However, we can test for regularity using the Myhill–Nerode theorem which provides a necessary and sufficient condition. So the problem should be decidable. Where is my mistake? Asked Read More …