Problem Detail: There is this question I read somewhere but could not answer myself. Assume I have an LR(1) Parsing table. Is there any way that just by looking at it and its items, can I deduce that it is also Read More …
Blog
[Solved]: Rules regarding Chomsky Normal Form (CNF) grammars
Problem Detail: I’m writing a context-free grammar that I hope will be in Chomsky Normal Form, and I have two questions: Can I use a single variable (a non-terminal) on the left-hand side of multiple rules? Can I use a single Read More …
[Solved]: Is Directed Graph a Graph?
Problem Detail: I came across an issue with the definition of a (directed) graph in Sipser’s Introduction to the theory of computation, 2nd Ed. On pp.10, An undirected graph, or simply a graph, is a set of points with lines connecting Read More …
[Solved]: Normalizing edge weights and the effect on Dijkstra’s algorithm
Problem Detail: If I had a graph $G$ with some negative edge weights, clearly Dijkstra’s algorithm does not definitely halt, since it might get caught in a negative cycle (shedding infinite weight). However, would finding the minimum weight (most negative weight) Read More …
[Solved]: Assign m agents to N points by minimizing the total distance
Problem Detail: Suppose we have $N$ fixed points (set $S$ with $|S|=N$) on the plane and $m$ agents with fixed, known initial positions ($m<N$) outside $S$. We should transfer the agents so that in our final configuration they are all positioned Read More …
[Solved]: What is an edge hop?
Problem Detail: I’ve tried googling it, but found nothing. Here is the context it’s in: From Bayesian Reasoning and Machine Learning: Adjacency matrices may seem wasteful since many of the entries are zero. However, they have a useful property that more Read More …
[Solved]: Big-O proof for a recurrence relation?
Problem Detail: This question is fairly specific in the manner of steps taken to solve the problem. Given $T(n)=2T(2n/3)+O(n)$ prove that $T(n)=O(n^2)$. So the steps were as follows. We want to prove that $T(n) le cn^2$. $$begin{align*} T(n)&=2T(2n/3)+O(n) &leq 2c(2n/3)^2+an &leq Read More …
[Solved]: Distributed algorithms – $alpha, beta$ synchronizers
Problem Detail: I experience a difficulty in solving exercises in distributed algorithm. Below is the the exercise I try to solve, it looks like I miss basic idea. Exercise. Consider a 15-processor asynchronous network with processors 0,…,14. The processors constantly run Read More …
[Solved]: Reconstructing files from binary
Problem Detail: Popular view tells us that any kind of information is just a collection of bits, that is zeroes and ones placed in a particular order. I was thus having this thought. Suppose that I have some kind of file Read More …
[Solved]: Turn biased random number generator into uniform
Problem Detail: I’m looking at a problem in the book Introduction to Algorithms by Cormen et al. It says that if we are given a random number generator rand() which satisfies the distribution: $P(X = 0) = p,;;P(X=1)=1-p,;;0<p<1$, then we can Read More …