# Rhetological fallacies

Copy from  here

## Appeal to Anonymous Authority

Using evidence from an unnamed 'expert', 'study' or generalized group (like 'scientists') to claim something is true.

“They say that it takes 7 years to digest chewing gum.”

# Find if integer x is prime

#### Level 1:

Check if all integers between 2 and x – 1 give non-zero remainder when divided into x.

#### Level 2:

Check if all integers between 2 and x/2 give non-zero remainder when divided into x.

# Modulo of a negative number

-b mod N = b(N-1) mod N

or:

int modulo(int x, int N){
return (x % N + N) % N;
}


Common incorrect implementation:

(−b) mod k = k − (b mod k).

References:

# Floating-point tolerance tests

Absolute tolerance:

• Not good for big numbers
abs(x–y) <= tol1


Relative tolerance:

• Not good for small numbers
abs(x–y) <= tol2 * max(abs(x), abs(y))

Combined tolerance test:

(abs(x-y) <= tol1) ||
(abs(x-y) <= tol2 * max(abs(x), abs(y))

equal to:

abs(x-y) <= tol1 * Max(1.0f, tol2/tol1 * max(abs(x), abs(y))

which for tol1=tol2 becomes:

abs(x-y) <= tol1 * Max(1.0f, abs(x), abs(y))

References:

• Real time collision detection, Christer Ericson

# Algorithms

Alternating least squares:

Online editors:

Fonts:

APIs:

Documentation:

Summary:

Examples:

Practice:

# Full Binary Tree Theorem

#### The theorem

Let T be a nonempty, full binary tree.

The theorem claims that the number of nodes N, the number of leaves L, and the number of internal nodes I are related in such a way that if you know any one of them, you can determine the other two. Continue reading Full Binary Tree Theorem