۞Warismatika ID
﴾ The underlying math ﴿

GCD & LCM

Almost every inheritance calculation rests on two simple integer operations: LCM (Least Common Multiple) to unify fractions, and GCD (Greatest Common Divisor) to simplify them. Grasp both, and the "base of the problem" and "tashih" steps stop feeling mysterious.

Why it matters in faraidh

GCD — Greatest Common Divisor

FPB

The largest number that divides two or more integers exactly. Used to simplify fractions and ratios.

Way 1 · Factorisation

Take the shared prime factors at the lowest power.

12 = 2² × 3
18 = 2 × 3²
GCD = 2 × 3 = 6
Way 2 · Euclid’s algorithm

Replace the larger with the remainder, repeat until it reaches 0.

18 mod 12 = 6
12 mod 6 = 0
GCD = 6

LCM — Least Common Multiple

KPK

The smallest number that is a multiple of two or more integers. Used to unify denominators — this is the base of the problem in faraidh.

Way 1 · Factorisation

Take all prime factors at the highest power.

4 = 2²
6 = 2 × 3
LCM = 2² × 3 = 12
Way 2 · Via the GCD

LCM(a, b) = a × b ÷ GCD(a, b).

GCD(4, 6) = 2
4 × 6 ÷ 2 = 12
LCM = 12
For beginners

Learn with pictures

Three ways to see GCD & LCM so they are easier to grasp.

Factor tree

Keep splitting the number until every tip is a prime (gold circle). That is its factorisation.

12 2 6 2 3
12 = 2 × 2 × 3
18 2 9 3 3
18 = 2 × 3 × 3
Venn diagram

Shared primes go in the middle (the overlap). From this one picture, both GCD and LCM appear at once.

Factors of 12 Factors of 18 2 2 3 3
GCD = multiply the MIDDLE
2 × 3 = 6
LCM = multiply ALL circles
2 × 2 × 3 × 3 = 36
Multiples line

Mark each number’s multiples on the line. The first meeting point is the LCM.

1 2 3 4 5 6 7 8 9 10 11 12 KPK = 12
Multiples of 4 Multiples of 6 12 — first meeting
A worked inheritance example

A man dies leaving a wife (1/8), his mother (1/6), and one son (the residue / 'asabah).

  1. 1. Fixed-share denominators: 8 and 6 → base = LCM(8, 6) = 24.
  2. 2. Shares: wife 1/8 × 24 = 3, mother 1/6 × 24 = 4, residue for the son = 24 − 7 = 17.
  3. 3. With a single son (no split across many heads) there is no tashih. When there are many heirs and the residue does not divide evenly, the GCD is used to simplify before tashih.

Try it in the Calculator — the base it shows is exactly the LCM of the denominators.

Test yourself

GCD & LCM practice