2022 Developer Survey is open! Take survey.
8 votes

Is Goedel's 1st theorem not algorithmically derivable?

Your reasoning is incorrect. It is true that your hypothetical "proof deriver" cannot derive all true statements. No proof derivation system can, and indeed, it is not even possible to express the ...
user avatar
  • 7,744
6 votes

Solve recurrence relations

This is similar to the recurrence arising in the analysis of Quicksort, search for "quicksort analysis" to get lots of results. An easy road is to write: \begin{align} (n + 1) T(n + 1) &= 2 \sum_{...
user avatar
  • 13.6k
5 votes

Find an upper bound for $T(n)=T(\sqrt{n})+10\log\log n$

An alternative solution still using domain transformation/change of variables. $$T(n) = T(\sqrt{n}) + \log \log n$$ 1. Let $m = \log n$ We can then define a new function $S$ based on how $m$ ...
user avatar
  • 4,361
5 votes
Accepted

Solve recurrence relations

To make life simple, assume $T(1)=1$. If we look at this just for integral powers of $k$, i.e. $n=k^m$ for some $k \in \mathbb Z$, we have, by definition, $$ T(k^m)=kT(k^{m-1})+ck\cdot k^m $$ We can ...
user avatar
  • 14.5k
5 votes

Existence of Efficient Set Difference Algorithm

You can compute $S\setminus T$ and $T\setminus S$ from $S$ and $T$ in $O(n+m)$ time using a hash table. Put all of list $S$ into a hashtable, and then iterate through list $T$ and look it up in the ...
user avatar
  • 140k
5 votes
Accepted

Every AVL tree may be red black tree

Your proof produces a tree in which all nodes are colored black. It doesn't necessarily satisfy the "black height" rule: Every path from a given node to any of its descendant NIL nodes contains the ...
user avatar
4 votes
Accepted

Simpler proof of Rabin's Compression Theorem?

It is hard to answer this question since it is hard to find a formal statement of Rabin's compression theorem. Here is one from the book Complexity Theory and Cryptology: An Introduction to ...
user avatar
4 votes
Accepted

Proof or refute $n^n = \Omega(n!)$ with the help of Stirling's approximation

Stirling's approximation states that $$ n! \sim \sqrt{2\pi n} (n/e)^n. $$ This notation means that the ratio between the two sides tends to 1 as $n$ tends to infinity. For your purposes, we can simply ...
user avatar
4 votes

If $f$ and $g$ are increasing functions, are we guaranteed that $f=O(g)$ or $g=O(f)$?

If $f = O(g)$, then $$\exists n_0. \exists c. \forall n. (n > n_0 \rightarrow f(n) \le c g(n))$$ The negation of this statement is $$\forall n_0. \forall c. \exists n. (n > n_0 \land f(n) >...
user avatar
4 votes
Accepted

Proving the loop invariant for a simple program in Hoare logic

Your invariant, together with the negation of the loop condition, is not strong enough to imply your postcondition. Try adding an additional conjunct to the invariant which, together with $\neg\ i<...
user avatar
4 votes
Accepted

Why is this a proof by contradiction for this algorithm? Isn't this a direct proof instead?

You seem to think the structure of the proof is: suppose the algorithm is incorrect; prove that the algorithm is, in fact, correct; this contradicts 1., so the algorithm is correct. That's almost, ...
user avatar
4 votes
Accepted

Show $\{0^𝑚1^𝑛|𝑚≠𝑛\}$ is not regular

Try to express in natural language what $\overline{L}$ contains; that is, what words $L$ doesn't contain. Most obviously, it's "words of the form $0^m0^n$, with $m = n$." However, it also ...
user avatar
3 votes
Accepted

Question about proving that Rado's function is non-computable

Thanks for the clarification! I really misinterpreted your question. Okay, so we have the computable function $f$, the also computable function $F$ that is based on $f$, and the Turing machine $M_F$ ...
user avatar
  • 173
3 votes
Accepted

Find an upper bound for $T(n)=T(\sqrt{n})+10\log\log n$

We can expand the recursion (ignoring the constant 10) as follows: $$ \begin{align*} T(n) &= \log \log n + \log \log n^{1/2} + \log \log n^{1/4} + \log \log n^{1/8} + \cdots \\ &= \log \log n +...
user avatar
3 votes
Accepted

If $f$ and $g$ are increasing functions, are we guaranteed that $f=O(g)$ or $g=O(f)$?

Here is a simple counterexample: $$ \begin{align*} &f(2m) = 2^{2^{4m}} & &g(2m) = 2^{2^{4m+1}} \\ &f(2m+1) = 2^{2^{4m+3}} & &g(2m+1) = 2^{2^{4m+2}} \end{align*} $$ The first ...
user avatar
3 votes
Accepted

Optimizing coin splitting - Is this algorithm as fast as I think?

You have made significant progress on this problem. Your final conclusion, "the overall algorithm asymptotically requires $\Omega(n^2)$ steps" is likely to be correct as well. Analysis of Your ...
user avatar
  • 33.1k
3 votes
Accepted

Is this proof for showing that $EQ_{CFG}$ is co-Turing-recognizable incorrect?

In this context, lexicographic order means: First order by length. Within each length, order lexicographically. You're saying that the proof is incorrect, but in fact it is only inaccurate in that ...
user avatar
3 votes

Why is this a proof by contradiction for this algorithm? Isn't this a direct proof instead?

It's a proof by contradiction that could easily be rewritten as a direct proof. To rephrase it as a direct proof, we divide it into two claims: $max$ is an element of $A$. $max \geq A[j]$ for all $j$...
user avatar
3 votes

Number of possible heaps on $\{1,...,2^h-1\}$

The definition you give looks like the definition of a complete tree. With the restriction that nodes are in $[\![1, 2^h-1]\!]$, then it is also a perfect tree of height $h$. Instead of looking at ...
user avatar
  • 7,154
3 votes

how to prove that log(n!) >= c n log(n) for some c >0?

$n! = n \cdot (n-1) \cdot ... \cdot 1 \ge n \cdot (n-1) \cdot ... \cdot (n/2) \ge (n/2)^{(n/2)}$ so $\log(n!)≥c\cdot n\cdot\log n$ for $c \ge 1/2$
user avatar
3 votes
Accepted

$\Phi_1=1$ or $\Phi_1=2$ for the dynamic $\text{Table-Insert}$ , where $\Phi_i$ is the potential function after $i$ th operation, as per CLRS

You have caught an instance of the infamous off-by-one error in that popular textbook whose name we shall not mention again. To repeat, it is correct that "the cost $c_1=1$, $\Phi_0=0$", &...
user avatar
  • 33.1k
3 votes

Not understanding this way of proving undecidability of the termination problem

This is a very succinct way of presenting the contradiction argument, and I strongly recommend you read a textbook on the topic, or some detailed explanations. There are tons of resources that explain ...
user avatar
  • 16.2k
3 votes
Accepted

Disprove: if L is decidable then Prefix(L) is decidable

It is correct that if $L$ is decidable language $\text{Prefix}(L)$ can be undecidable. The language $L$ given in the question is a concise example of a decidable language the prefix language of which ...
user avatar
  • 33.1k
2 votes

Existence of Efficient Set Difference Algorithm

The nature of the answer depends on what you are attempting to optimize (e.g. computation, communication, interactivity) and the computational model (e.g. deterministic, probabilistic,distributed/...
user avatar
2 votes

If $f$ and $g$ are increasing functions, are we guaranteed that $f=O(g)$ or $g=O(f)$?

Here's an explicit construction of $f$ and $g$ such that neither $f=O(g)$ nor $g=O(f)$. To make the calculations slightly easier, I've chosen $g$ to be increasing and $f$ to be nondecreasing (namely, $...
user avatar
  • 14.5k
2 votes
Accepted

Algorithm to recognize Strongly Regular Graph (SRG)

There is a trivial $O(kn^2)$ algorithm: Choose a vertex $v$ and calculate its degree $k$. Then verify that all other vertices have degree $k$. Choose some neighbor $w$ of $v$ and calculate the number ...
user avatar
2 votes
Accepted

Proof Review: Integer Factorization is in NP

You are missing something. If you are given what is supposed to be a factorisation of a number x, it's not enough to show that the product of those numbers is x. You also have to prove that all the ...
user avatar
  • 24.9k
2 votes

Is Goedel's 1st theorem not algorithmically derivable?

Our proof deriver enumerates all possible axiomatic systems But the set of possible axiomatic systems also include the inconsistent systems. On the other hand, the consistent axiomatic systems are ...
user avatar
2 votes
Accepted

Show that function is not turing-computable?

This proof is correct as written, well done :) Remember this pattern, because an identical proof can be used in a wide variety of similar problems such as rational/irrational numbers and polynomials/...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible