Difference Between Small and Big-step Operational Semantics

What’s the fundamental difference(s) between small and big-step operational semantics? I’m having a hard time grasping what it is and the motivation for having the two. Answer Small-step semantics defines a method to evaluate expressions one computation step at a time. Formally speaking, a small-step semantics for an expression language E is a relation →:E×E … Read more

Why is selection sort faster than bubble sort?

It is written on Wikipedia that “… selection sort almost always outperforms bubble sort and gnome sort.” Can anybody please explain to me why is selection sort considered faster than bubble sort even though both of them have: Worst case time complexity: O(n2) Number of comparisons: O(n2) Best case time complexity : Bubble sort: O(n) … Read more

Difference between a turing machine and a finite state machine?

I am doing a presentation about Turing machines and I wanted to give some background on FSM’s before introducing Turing Machines. Problem is, I really don’t know what is VERY different from one another. Here’s what I know it’s different: FSM has sequential states depending on the corresponding condition met while Turing machines operate on … Read more

Would the P vs. NP problem become trivial as a result of the development of universal quantum computers?

If someone were to build a universal quantum computer, would that have any implications on the problem of P vs. NP? Answer No, there will be absolutely no implication, for several reasons: The P vs. NP problem is about classical computation rather than quantum computation. Even if quantum computers could solve NP-hard problems in polynomial … Read more

What is the significance of context-sensitive (Type 1) languages?

Seeing that in the Chomsky Hierarchy Type 3 languages can be recognised by a state machine with no external memory (i.e., a finite automaton), Type 2 by a state machine with a single stack (i.e. a push-down automaton) and Type 0 by a state machine with two stacks (or, equivalently, a tape, as is the … Read more

on “On the cruelty of really teaching computing science”

Dijkstra, in his essay On the cruelty of really teaching computing science, makes the following proposal for an introductory programming course: On the one hand, we teach what looks like the predicate calculus, but we do it very differently from the philosophers. In order to train the novice programmer in the manipulation of uninterpreted formulae, … Read more

Do lossless compression algorithms reduce entropy?

According to Wikipedia: Shannon’s entropy measures the information contained in a message as opposed to the portion of the message that is determined (or predictable). Examples of the latter include redundancy in language structure or statistical properties relating to the occurrence frequencies of letter or word pairs, triplets etc. So entropy is a measure of … Read more

What does being Turing complete mean?

I see that most definitions of what it is to be Turing-complete are tautological to a degree. For example if you Google “what does being Turing complete mean”, you get: A computer is Turing complete if it can solve any problem that a Turing machine can… While it is very well defined whether different systems … Read more