Most Popular
1500 questions
11
votes
2 answers
Name of this rearranging/sorting problem?
You are given an array of length $n$. Each element of the array belongs to one of $K$ classes. You are supposed to rearrange the array using minimum number of swap operations so that all elements from the same class are always grouped together, that…

Marko Bukal
- 141
- 4
11
votes
1 answer
Proving that directed graph diagnosis is NP-hard
I have a homework assignment that I've been bashing my head against for some time, and I'd appreciate any hints. It is about choosing a known problem, the NP-completeness of which is proven, and constructing a reduction from that problem to the…

user8879
- 113
- 5
11
votes
1 answer
Why are computable functions continuous?
I am working on writing an easy to read document about denotational semantics of the lambda calculus. For that I introduce CPOs, monotonicity and continuity.
A CPO is a set $M$ with a partial order $\leq$ and a bottom element $\bot$, requiring…

user3389669
- 327
- 1
- 8
11
votes
1 answer
How does Stack Inspection work?
This is precursor to my other, more advanced question about Stack Inspection.
Stack Inspection is a security mechanism introduced in the JVM to deal with running code originating from locations having different levels of trust. This is question aims…

Dave Clarke
- 20,205
- 4
- 68
- 113
11
votes
2 answers
Decidable properties of computable reals
Is "Rice's theorem for the computable reals" -- that is, no nontrivial property of the number represented by a given computable real is decidable -- true?
Does this correspond in some direct way to the connectedness of the reals?

Shachaf
- 213
- 1
- 5
11
votes
2 answers
modular multiplication
I was reading the Modular Multiplication page on wikipedia...and could not understand the algorithm to compute $a \cdot b \pmod{m}$.
uint64_t mul_mod(uint64_t a, uint64_t b, uint64_t m)
{
long double x;
uint64_t c;
int64_t r;
if (a >= m) a…

user -1
- 111
- 1
- 5
11
votes
1 answer
TCP Connection Termination - FIN, FIN ACK, ACK
I've been reading that to terminate a TCP connection 3 handshakes are required: FIN, FIN ACK, and ACK. However, when closing a connection, Wireshark displays FIN ACK, FIN ACK, ACK; it never displays FIN by itself.
However, when establishing a…

Jack
- 165
- 2
- 2
- 8
11
votes
3 answers
What is the difference between quantum computing and parallel computing?
Quantum computing essentially relies on the fact that qubits maintain multiple possible states simultaneously. Parallel computing too processes multiple states simultaneously. So what is the difference or how are they different?

Raghavendra Singh Dasila
- 141
- 1
- 7
11
votes
1 answer
I built a mechanical computer powered by marbles. What are its theoretical limitations?
Over the last couple years, I built a mechanical computer powered by marbles and made a game out of it. It's similar to the old Digi-Comp II, except for two key differences:
Parts are repositionable on the board.
You can connect multiple 'bits'…

Paul Boswell
- 113
- 6
11
votes
1 answer
How can ws with |w| = |s| and w ≠ s be context-free while w#s is not?
Why does (if so) the seperator $\#$ is making a difference between the two languages ?
Let say:
$L=\{ws : |w|=|s|\, w,s\in \{0,1\}^{*}, w \neq s \}$
$L_{\#}=\{w\#s : |w|=|s|\, w,s\in \{0,1\}^{*}, w \neq s \}$
Here is a proof and a grammer…

limitless
- 266
- 1
- 2
- 8
11
votes
5 answers
How to determine if an automata (DFA) accepts an infinite or finite language?
Given an automata [DFA $A=(Q,Σ,δ,q_0,F)$], is there a way to determine whether it accepts an infinite or finite language?

Davis8988
- 213
- 1
- 2
- 5
11
votes
2 answers
Which kind of branch prediction is more important?
I have observed that there are two different types of states in branch prediction.
In superscalar execution, where the branch prediction is very important, and it is mainly in execution delay rather than fetch delay.
In the instruction pipeline,…
user123
11
votes
3 answers
Represent a 5 card poker hand
A deck of cards is 52. A hand is 5 cards from the 52 (cannot have a duplicate).
What is the least amount of bits to represent a 5 card hand and how?
A hand is NOT order dependent (KQ = QK). 64329 = 96432
Yes, can use 52 bits. That can represent a…

paparazzo
- 431
- 3
- 13
11
votes
4 answers
Finding "fingerprint" sets
Let's say we have 10 people, each with a list of favorite books. For a given person X, I would like to find a special subset of X's books liked only by X, i.e. there is no other person that likes all of the books in X's special subset. I think of…

edron79
- 176
- 6
11
votes
3 answers
Why are most mutex implementations unfair?
My understanding is that most popular implementations of a mutex (e.g. std::mutex in C++) do not guarantee fairness -- that is, they do not guarantee that in instances of contention, the lock will be acquired by threads in the order that they called…

Jeremy Friesner
- 267
- 2
- 7