Most Popular

1500 questions
12
votes
6 answers

Can a Turing machine decide the language $L_\emptyset$ of machines with empty language?

Let $$L_\emptyset = \{\langle M\rangle \mid M \text{ is a Turing Machine and }L(M)=\emptyset\}.$$ Is there a Turing machine R that decides (I don't mean recognizes) the language $L_\emptyset$? It seems that the same technique used to show that $\{A…
Mahdi
  • 579
  • 3
  • 6
  • 10
12
votes
2 answers

Linear time labeling algorithm for a tree?

I have an undirected tree whose vertices I want to label. The leaf nodes should be labeled one. Then, assume the leaves were removed. In the tree that remains, the leaves should be labeled two. This process continues in the obvious way until all…
Bob Whiz
  • 123
  • 5
12
votes
3 answers

What is the difference between Multiprogramming and Multitasking

I am finding it difficult to clearly differentiate between Multiprogramming and Multitasking. My primary source has been Wikipedia, but the WP article seems to be a little at odds with some less reputable sources (like my college professor). As I…
jsj
  • 670
  • 3
  • 8
  • 12
12
votes
3 answers

What is the meaning of 'breadth' in breadth first search?

I was learning about breadth first search and a question came in my mind that why BFS is called so. In the book Introduction to Algorithms by CLRS, I read the following reason for this: Breadth-first search is so named because it expands the…
KhiladiBhaiyya
  • 243
  • 2
  • 8
12
votes
2 answers

Finding the language generated by a context-free grammar

This is a question from the Dragon book (I apologize for translation mistakes, I don´t have the English version on hand): What language is generated by this grammar? $S \rightarrow a S b S \mid b S a S \mid \epsilon$ I don't know what I'm…
dan
  • 223
  • 1
  • 3
  • 8
12
votes
1 answer

Why use heap over red-black tree?

Heap supports insert operation in $O(\log n)$ time. And while heap supports remove min/max in $O(\log n)$ time, to remove any element (non min/max) heap takes $O(n)$ time. However, red-black tree supports insert/remove both in $O(\log n)$ time. We…
Wonjoo Lee
  • 123
  • 1
  • 5
12
votes
4 answers

Does the complexity of strongly NP-hard or -complete problems change when their input is unary encoded?

Does the difficulty of a strongly NP-hard or NP-complete problem (as e.g. defined here) change when its input is unary instead of binary encoded? What difference does it make if the input of a strongly NP-hard problem is unary encoded? I mean, if I…
user2145167
  • 693
  • 4
  • 13
12
votes
1 answer

The "CPS" approach has done great harm to performance in SML/NJ; reasoning desired

In a comment to Learning F#: What books using other programming languages can be translated to F# to learn functional concepts? Makarius stated: Note that the "CPS" approach has done great harm to performance in SML/NJ. Its physical evaluation…
Guy Coder
  • 5,091
  • 2
  • 29
  • 64
12
votes
2 answers

Difference between Lamport timestamps and Vector clocks

Lamport timestamps and vector clocks sound like almost the same thing. Both are used to determine the order of events in a distributed system. What are their key differences?
bkoodaa
  • 367
  • 2
  • 3
  • 13
12
votes
2 answers

Word factorization in $O(n^2 \log n)$ time

Given two strings $S_1, S_2$, we write $S_1S_2$ for their concatenation. Given a string $S$ and integer $k\geq 1$, we write $(S)^k = SS\cdots S$ for the concatenation of $k$ copies of $S$. Now given a string, we can use this notation to 'compress'…
Timon Knigge
  • 327
  • 1
  • 9
12
votes
3 answers

Decidable languages and unrestricted grammars?

Turing machines and unrestricted grammars are two different formalisms that define the RE languages. Some RE languages are decidable, but not all are. We can define the decidable languages with Turing machines by saying that a language is decidable…
templatetypedef
  • 9,102
  • 1
  • 30
  • 60
12
votes
2 answers

If $L$ is a subset of $\{0\}^*$, then how can we show that $L^*$ is regular?

Say, $L \subseteq \{0\}^*$. Then how can we prove that $L^*$ is regular? If $L$ is regular, then of course $L^*$ is also regular. If $L$ is finite, then it is regular and again $L^*$ is regular. Also I have noticed that, for $L = \{0^p \mid p \text{…
ChesterX
  • 239
  • 3
  • 7
11
votes
1 answer

Not able to convert from NFA to DFA

I have a simple problem of making a DFA which accepts all inputs starting with double letters (aa, bb) or ending with double letters (aa, bb), given $\Sigma =\{a, b\}$ is the alphabet set of the given language. I tried to solve it in a roundabout…
Anurag Kalia
  • 503
  • 2
  • 11
11
votes
4 answers

What does the leading turnstile operator mean?

I know that different authors use different notation to represent programming language semantics. As a matter of fact Guy Steele addresses this problem in an interesting video. I'd like to know if anyone knows whether the leading turnstile operator…
Jim Newton
  • 315
  • 3
  • 11
11
votes
2 answers

How to prove that $n(\log_3(n))^5 = O(n^{1.2})$?

This a homework question from Udi Manber's book. Any hint would be nice :) I must show that: $n(\log_3(n))^5 = O(n^{1.2})$ I tried using Theorem 3.1 of book: $f(n)^c = O(a^{f(n)})$ (for $c > 0$, $a > 1$) Substituing: $(\log_3(n))^5 =…