Problem Detail: I have a problem whose lower bound of problem complexity is proven to be $O(n+m)$ (n < m) and I also come up with an algorithm whose time complexity is $ O(n+m)$, space complexity is $ O(n)$. (All on Read More …
Blog
[Solved]: Counting inversion pairs – $n^2$ results in $n log n$ time?
Problem Detail: The number of possible inversions in an array is bounded by $binom{n}{2}$, i.e $frac{n(n-1)}{2} in O(n^2)$. How it is possible to calculate $O(n^2)$ results in $O(nlog n)$ time using something like modified merge sort? (sample algo : http://www.geeksforgeeks.org/counting-inversions/). Asked Read More …
[Solved]: Equivalent Straight Line Embedding of a Planar Graph Drawing on a Grid
Problem Detail: An embedding of a graph G on a surface Σ is a representation of G on Σ in which points of Σ are associated to vertices and simple arcs are associated to edges in such a way that: the Read More …
[Solved]: Karger’s algorithm: why does every vertex have degree at least the number of edges crossing a min cut?
Problem Detail: I’m currently watching a video on the analysis of Krager’s Algorithm, and I am confused about something. The analysis goes as follows: Fix a min cut $(A,B)$. Let $k$ = # of edges crossing $(A,B)$ , these edges will Read More …
[Solved]: What’s the difference between physically based rendering and global illumination?
Problem Detail: I know that Physically based rendering means we try to simulate how light actually works in real world and global illumination is bouncing back of light when it strikes a surface. But what’s actual difference between them and how Read More …
[Solved]: How to use frame based speech features for learning using a neural network classifier?
Problem Detail: I am doing supervised learning on speech audio files using neural networks. For this purpose, I’ll have to extract features from the audio file. But since an audio file is a time varying signal, it is generally divided into Read More …
[Solved]: Finding a good loop invariant
Problem Detail: I want to prove that the following program is correct. The code takes an array i of length N and a number x. At the end, the value of found should be true if the array contains x and Read More …
[Solved]: Do all greedy algorithm produce just the first solution, no matter how bad it is?
Problem Detail: In all the exampls of the greedy algorithms I’ve seen so far, such as activity selection problem and unit-sized set coverage problem, the algorithm is usually very simple and intuitive and returns the first set that satisfies the constrain Read More …
[Solved]: Count-Min sketch: dyadic ranges
Problem Detail: Can anyone give me a proof as to why Any range over a unviverse {1…n} can be reduced to at most $2log_2n$ disjoint dyadic ranges? Where a dyadic range is a range of the form $[x2^y+1….(x+1)2^y]$. This is in Read More …
[Solved]: Why is the OS design able to reduce power consumption?
Problem Detail: I have read that OSes like Android and iOS are somehow optimised to improve battery life. My understanding is that a CPU executes a certain number of operations in a certain time, so I would think that you can Read More …