Problem Detail: This is the problem I have: Compute the Hamming code with odd parity for the memory word 1101 1001 0001 1011 (2 pts.). In your solution, mark the parity bits as in the following example, where parity bits are: Read More …
Author: ignougroup
[Solved]: How to prove polynomial time equivalence?
Problem Detail: Define the problem $W$: Input: A multi-set of numbers $S$, and a number $t$. Question: What is the smallest subset $s subseteq S$ so that $sum_{k in s} k = t$, if there is one? (If not, return none.) Read More …
[Solved]: Understanding Expected Running Time of Randomized Algorithms
Problem Detail: I want to understand the expected running time and the worse-case expected running time. I got confused when I saw this figure (source), where $I$ is the input and $S$ is the sequence of random numbers. What I don’t Read More …
[Solved]: Algorithm for constructing BST from post-order traversal
Problem Detail: Given a post-order traversal of Binary Search tree with $k$ nodes, find an algorithm that constructs the BST. My Algortihm Let $n$ represent the next element to be inserted. Let $P(y)$ represent the parent of node $y$. We will 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]: 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]: 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]: 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]: 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]: Why are loops faster than recursion?
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 …