Algorithms in Math - Key Notes
Algorithms in Math - Key Notes
🔹 What is an Algorithm?
● An algorithm is a step-by-step procedure for solving a mathematical problem or
performing a computation.
● It has a clear starting and ending point, and each step is precisely defined.
5. Effectiveness – Basic enough to be carried out with simple tools (e.g., paper and
pencil).
Steps:
java
CopyEdit
while b ≠ 0:
temp = b
b = a % b
a = temp
return a
●
✅ 2. Prime Factorization
● Breaks a number into prime factors using division by primes.
● Example: 60 → 2 × 2 × 3 × 5
✅ 3. Sieve of Eratosthenes
● Finds all prime numbers up to a given number n.
✅ 6. Newton-Raphson Method
● Finds roots of real-valued functions numerically.
● Iterative formula:
xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}xn+1=xn−f′(xn)f(xn)
🔹 Algorithm vs Formula
● Algorithm = Process (how to solve)
● Formula = Expression (what to calculate)
🔹 Practice Tip:
Try writing your own algorithms for:
● Calculating factorials