Problem Detail: I am referring to the algorithm from the Wikipedia page on the Floyd–Warshall algorithm. In case of undirected graphs should I change the assignment statement inside the if condition to dist[i][j] = dist[j][i] = dist[i][k] + dist[k][j] or they Read More …
Category: Uncategorized
Pushdown automaton for complement of { ww | … }
Problem Detail: I want to be able to describe the idea behind the pushdown automaton (no tables or diagrams). So, I already know that $L = { ww mid w text{ in } (0,1)^*}$ is not context free. Since CFL are Read More …
What is the best solution to find whether the sum of an array is even or odd
Problem Detail: I was asked this question in an interview. I was not able to find a better solution than $O(n)$ which is just going over the array and finding the sum. Can it be done any better? I am not Read More …
When should I learn artificial intelligence?
Problem Detail: Straight to the point: I would really like to learn AI. But I want some advice from experienced CS guys as to when I should jump into Artificial Intelligence. What prerequisites are needed in order for me to better Read More …
Maximum sub-matrix sum
Problem Detail: Given a $ntimes m$ matrix $A$ of integers, find a sub-matrix whose sum is maximal. If there is one row only or one column only, then this is equivalent to finding a maximum sub-array. The 1D version can be Read More …
Is there any uncountable Turing decidable language?
Problem Detail: There are many(and I mean many) countable languages which are Turing-decidable. Can any uncountable language be Turing decidable? Asked By : Jyotirmoy Pramanik Answered By : Yuval Filmus Every language over a finite (or even countable) alphabet is countable. Assuming your Read More …
How to stop genetic algorithm population converging to a single value
Problem Detail: I’ve written a genetic algorithm (GA) that solves a 7-dimensional optimisation problem. All seven variables are floating point numbers. The problem is that the entire population seems to converge to very nearly the same point in the solution space Read More …
Deadlock and cycle in a resource allocation graph
Problem Detail: Here is a resource allocation graph asked in my Operating Systems Theory midterm. The question is, “Is there a deadlock here? Explain your answer in detail” Ra and Rb are resource sets and every dot inside of them Read More …
Example of a non-context free language that nonetheless CAN be pumped?
Problem Detail: So basically L satisfies the conditions of the pumping lemma for CFL’s but is not a CFL (that is possible according to the definition of the lemma). Asked By : user2329564 Answered By : Yuval Filmus The classical example is $L Read More …
How to calculate probability of packet loss and drop rate?
Problem Detail: In a queuing system (M/M/1) with a finite packet capacity $z$, how do you determine the probability of packet loss if we assume that packets are dropped when the system is full? Packets arrive with a rate $lambda$ and Read More …