Problem Detail: The cyclic shift (also called rotation or conjugation) of a language $L$ is defined as ${ yx mid xy in L }$. According to wikipedia (and here) the context-free languages are closed under this operation, with references to papers Read More …
Blog
How to encode date as input in neural network?
Problem Detail: I am using neural networks to predict a time series. The question I’m facing now is how do I encode date/time/serial no. of each input set as an input to the neural network? Should I use 1 of C Read More …
Longest path in undirected tree
Problem Detail: Given an undirected tree (with no specific root), how to find the longest path, i.e. 2 vertices that are the farthest apart from each other? There are no lengths associated with the edges (each edge has length 1 by Read More …
Languages that satisfy the pumping lemma but aren’t regular?
Problem Detail: Given a regular language $L$, then it is easy to prove that there is a constant $N$ such that is $sigma in L$, with $lvert sigma rvert ge N$ there exist strings $alpha$, $beta$ and $gamma$ such that $lvert Read More …
Shortest distance between a point in A and a point in B
Problem Detail: Given two sets $A$ and $B$ each containing $n$ disjoint points in the plane, compute the shortest distance between a point in $A$ and a point in $B$, i.e., $min space {mbox{ } text{dist}(p, q) mbox{ } | Read More …
Optimal Algorithm for checking if a number is a multiple of three
Problem Detail: I’m just starting a course on Computational Number Theory and have very little Computer Science background but definitely know enough about the big-O notation. I currently have an assignment to work on: An algorithm reads in the binary digits Read More …
What does “context” in “context-free grammar” refer to?
Problem Detail: There are lots of definitions online about what a Context-Free Grammar is, but nothing I find is satisfying my primary trouble: What context is it free of? To investigate, I Googled “context sensitive grammar” but I still failed to Read More …
Can every self-modifying algorithm be modelled by a non-selfmodifying algorithm?
Problem Detail: If we have any arbitrary computer program that can modify its instructions, is it possible to simulate that program with a program that cannot modify its instructions? Edit: I am new to stackexchange so not sure if I’m allowed Read More …
A string representation of any Turing machine
Problem Detail: The set of all Turing machines is said to be countable. The central idea of the proof of this fact is that every Turing machine can be written as a finite string of characters. I am having trouble seeing Read More …
Space complexity analysis of binary recursive sum algorithm
Problem Detail: I was reading page 147 of Goodrich and Tamassia, Data Structures and Algorithms in Java, 3rd Ed. (Google books). It gives example of linear sum algorithm which uses linear recursion to calculate sum of all elements of the array: Read More …