Problem Detail: In Coq, you can use two different kinds of keywords to do definitions–Inductive and Definition. I do not understand the difference between an inductive and a definition, or when it is appropriate to use one instead of the other. Read More …
Category: Uncategorized
[Solved]: Exercise on Divide&Conquer’s technique
Problem Detail: I need help on this exercise: You are given an array of n elements, and you notice that some of the elements are duplicates; that is, they appear more than once in the array. Show how to remove all Read More …
[Solved]: Where in the Chomsky Hierarchy are Regular Expressions as a language?
Problem Detail: I’m referring to regular expressions as language: begin{equation*} Sigma = { “a”, “b”, “(“, “)”, “*”, … } end{equation*} and begin{equation*} L = Sigma^* text{, which form a legal regular expression} end{equation*} I am not referring to their computational Read More …
[Solved]: Number of digits in a binary product
Problem Detail: Assume i have 2 numbers in binary form (or, more precisely, assume to know the number of their digits, DF1, DF2): 101010101001010101010101010111111111111111111111010101 10101111111111111111010101 Is there a formula for the exact number of binary digits (DP) of the product? DP Read More …
[Solved]: Does NP-completeness require to find the solution?
Problem Detail: In the paper “Computing Equilibria:A Computational Complexity Perspective” by Tim Roughgarden, they consider the problem: Problem 2.1 (Clique). Given a graph $G = (V, E)$ and an integer $k$: if there is a set $K ⊆ V$ with $|K| Read More …
[Solved]: Multiplication in $O(ncdot log n)$
Problem Detail: I was looking in here, and I noticed the best runtime for multiplication of two $n$-bits numbers is $O(ncdot log n cdot 2^{O(log^* n)}$, but I can easily notice an algorithm that runs in $O(ncdot log n)$. After all, Read More …
[Solved]: Use Dijkstra to find negative cycles in a graph
Problem Detail: I will state the problem: Suggest an algorithm that works in $O(|E| + |V|log|V|)$ time that checks if there are negative cycles in a graph. So, I saw the runtime, and I immediately said we need to use Dijsktra’s Read More …
[Solved]: Go Back N ARQ Question
Problem Detail: I am a computer science under graduation student, and was going through some Go Back N ARQ (Computer Networking) videos on YouTube, and got a doubt in a question, which according to me should have a different answer than Read More …
[Solved]: Why can’t we round results of linear programming to get integer programming?
Problem Detail: If linear programming suggests that we need $2.5$ trucks to deliver goods, why can’t we round up and say $3$ trucks are needed? If linear programming suggests we can afford only $3.7$ workers, then why can’t we just Read More …
[Solved]: Understanding hashtable performance in the worst-case
Problem Detail: Under assumption that the hash function is uniform, we have worst-case performance for the search operation in a separate-chaining (e.g. java.util.HashMap) hashtable $O(log n)$. Why? I cannot really understand this. If we have a uniformly-distributed hash values it should Read More …