Question Detail: I’ve heard several times that for sufficiently small values of n, O(n) can be thought about/treated as if it’s O(1). Example: The motivation for doing so is based on the incorrect idea that O(1) is always better than O(lg Read More …
Blog
What is the difference between halting, accepting, and deciding in the context of Turing machines?
Question Detail: Does accepting mean that the TM will read and recognize a char from the cell it’s currently reading from? And is it the case that a TM halts iff the input is decidable? Asked By : sdfasdgasg Best Answer from Read More …
How to implement a prolog interpreter in a purely functional language?
Question Detail: Is there a clear reference, with pseudo-code, on how to go about implementing a Prolog interpreter in a purely functional language? That which I have found so far seems to deal only with imperative languages, is merely a demonstration Read More …
Why is the Kleene star operator also called the Kleene 'closure' operator?
Question Detail: I’ve found that if I don’t understand the etymology behind a cs/programming term, it usually means that I’ve missed or misunderstood some important underlying concept. I don’t understand why the Kleene star is also called the Kleene closure. Is Read More …
Why is the Kleene star operator also called the Kleene ‘closure’ operator?
Question Detail: I’ve found that if I don’t understand the etymology behind a cs/programming term, it usually means that I’ve missed or misunderstood some important underlying concept. I don’t understand why the Kleene star is also called the Kleene closure. Is Read More …
How to implement a prolog interpreter in a purely functional language?
Question Detail: Is there a clear reference, with pseudo-code, on how to go about implementing a Prolog interpreter in a purely functional language? That which I have found so far seems to deal only with imperative languages, is merely a demonstration Read More …
What is the difference between halting, accepting, and deciding in the context of Turing machines?
Question Detail: Does accepting mean that the TM will read and recognize a char from the cell it’s currently reading from? And is it the case that a TM halts iff the input is decidable? Asked By : sdfasdgasg Best Answer from Read More …
“For small values of n, O(n) can be treated as if it’s O(1)”
Question Detail: I’ve heard several times that for sufficiently small values of n, O(n) can be thought about/treated as if it’s O(1). Example: The motivation for doing so is based on the incorrect idea that O(1) is always better than O(lg Read More …
Finding the path of a negative weight cycle using Bellman-Ford
Question Detail: I wrote a program which implements Bellman-Ford, and identifies when negative weight cycles are present in a graph. However what I’m actually interested in, is given some starting vertex and a graph, which path do I actually trace to Read More …
Why is encrypting with the same one-time-pad not good?
Question Detail: To encrypt a message $m_1$ with a one-time-pad key $k$ you do $Enc(m_1,k) = m_1 oplus k$. If you use the same $k$ to encrypt a different message $m_2$ you get $Enc(m_2,k) = m_2 oplus k$, and if you Read More …