2022 Developer Survey is open! Take survey.

# Tag Info

### 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 ...
• 7,744

### 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_{...
• 13.6k

### 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$ ...
• 4,361
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 ...
• 14.5k

### 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 ...
• 140k
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 ...
• 269k
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 ...
• 269k
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 ...
• 269k

• 269k
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 ...
• 269k
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 ...
• 33.1k
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 ...
• 269k

### 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$...
• 269k

### 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 ...
• 7,154

### 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$
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$", &...
• 33.1k

### 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 ...
• 16.2k
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 ...
• 33.1k

### 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/...

• 269k
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 ...
• 24.9k