maths.freeDiscrete Math & Logic › Algorithms and growth of functions

Algorithms and growth of functions

Big-O notation, comparing growth rates, and what "efficient" means.

Big-O compares functions by eventual growth: n² is O(n³), 2ⁿ dominates every polynomial, n! dominates 2ⁿ. Picture it: the graphs of n, n log n, n², 2ⁿ pulling apart. Think it: P vs NP asks whether a whole class of problems is polynomial — the Frontiers page.

مثال عملي: limit of (2^n)/(n!) as n -> oo

Limit of 2^n/factorial(n) as n → oo

\lim_{n \to \infty} \frac{2^{n}}{n!}

خطوة خطوة

  1. \lim_{n \to \infty^+-} \frac{2^{n}}{n!}

    Try direct substitution first.

  2. \

    As x grows without bound, compare the fastest-growing terms (or divide top and bottom by the highest power).

  3. = 0

    Take the limit.

كشفت الإجابة
0

Symbols used here

\lim_{x \to a} f(x)
limit
The value f(x) approaches as x approaches a.
\infty
infinity
Not a number: "grows without bound" in limits and intervals.
\sup,\ \inf
supremum, infimum
Least upper bound, greatest lower bound.
O(n^2),\ \Theta,\ \Omega
big-O notation
Grows no faster than n² (up to a constant), for large n.
n!
factorial
n × (n−1) × … × 1; the number of orderings of n things. 0! = 1.
\binom{n}{k}
binomial coefficient, "n choose k"
Number of k-element subsets of n things: n!/(k!(n−k)!).
\sum_{k=1}^{n} a_k
summation
Add a_k for k = 1 up to n.
x \in A,\ A \subseteq B
element of, subset
x belongs to A; every element of A is in B.
A \cup B,\ A \cap B,\ A \setminus B
union, intersection, difference
In either; in both; in A but not B.
\emptyset,\ |A|
empty set, cardinality
The set with no elements; the number of elements of A.
\forall,\ \exists
for all, there exists
Quantifiers: every x; at least one x.
\neg,\ \wedge,\ \vee,\ \Rightarrow,\ \Leftrightarrow
not, and, or, implies, iff
Logical connectives.
\blacksquare\ \text{or}\ \square
end of proof (halmos)
Marks the point where the statement has been established.
a \equiv b \pmod n
congruent modulo n
n divides a − b; a and b have the same remainder.
a \bmod n
remainder
What is left after dividing a by n.

How to: Algorithms and growth of functions

  1. Try direct substitution first.
  2. As x grows without bound, compare the fastest-growing terms (or divide top and bottom by the highest power).
  3. Take the limit.

Questions people ask

What makes mathematics "discrete"?

It deals with separate, countable objects — integers, graphs, statements — rather than continuous quantities. No limits, no infinitesimals; instead induction, counting and logic.

How does a proof by induction work?

Show the statement for the first case, then show that whenever it holds for n it holds for n + 1. Like dominoes: the first falls, and each knocks over the next.

جرّب نفسك

أكثر في Discrete Math & Logic