Problem Detail: I was learning some basic sorting techniques with their complexity. However I cannot understand why only the number of comparisons are taken into account while calculating time complexity and operations such as swap are ignored. Link to selection sort Read More …
Blog
[Solved]: Calculating time complexity of two interdependent nested for loops
Problem Detail: Consider the following code segment : for (int i = 1; i <= n; i++ ) { for (int j = 1; j <= n; j = j + i ) { printf(“Hi”); } } Here, the outer loop Read More …
[Solved]: Removing left-recursion in grammar while maintaining left-association of operator
Problem Detail: I have a problem with this exercise: Let G be the following ambiguous grammar for the λ-calculus: E → v | λv.E | EE | (E) where E is the single non-terminal symbol, λv.E represents abstraction w.r.t. the variable Read More …
[Solved]: Proving regular languages are closed under a form of interleaving
Problem Detail: I’ve got the following definitions: $$mathrm{Interleave},(x,y) = {w_1dots w_nmid w_iin{x_i,y_i} text{ for }i=1, dots, |x|}$$ when $x$, $y$ and $w$ are words with $|x|=|y|$ and $w_i$ means the $i$-th letter in $w$. $$mathrm{Interleave},(L_1,L_2) = !!!!bigcup_{substack{xin L_1, yin L_2, |x|=|y|}}!!!! Read More …
[Solved]: Is there a repository for the hierarchy of proofs?
Problem Detail: I am self-learning proof assistants and decided to start on some basic proofs and work my way up. Since proofs are based on other proofs and so form a hierarchy, is there a repository of the hierarchy of proofs? Read More …
[Solved]: Why can’t fibers utilize multiple processors?
Problem Detail: It seems that the distinction between fibers and threads is that fibers are cooperatively scheduled, whereas threads are preemptively scheduled. The point of the scheduler seems like a way to make an otherwise serial processor resource act in a Read More …
[Solved]: Can you solve 2-sat problem when truth assignments of some variables are determined
Problem Detail: I am trying to find a assignment to satisfy a 2-sat statement. Problem is some of the clauses are 0 or x or 1 or x. I think the 1 or x clauses have no effect on the solution, Read More …
[Solved]: Why are progress bars so inaccurate?
Problem Detail: Computers and programming languages tend to be deterministic and predictable. Yet progress bars seem the opposite, especially if the operation is complex. Even for world class professional products, some progress bars do little to reflect the real progress of Read More …
[Solved]: what are read/write operations involved in main memory, cache and processor?
Problem Detail: please bear with me, I always get confused with the terminologies used in my computer architecture class. What are read and write operations exactly? What are their relationship with processor, main memory, and cache? I always thought that load/store Read More …
[Solved]: Proper terminology in Prolog/logical programming theory?
Problem Detail: I have a good understanding of how to program using logic languages, but I’m currently writing up a paper describing some of my work, and I wanted to ensure that I wasn’t abusing the proper terminology when describing logic Read More …