Description
Gurpreet Singh (150259)
Introduction
When we are multiplying two 2-digit numbers, we can reduce a few cases into a simple formula, rather than actually calculating the multiplication.
Case Analysis for 2-digit Multiplication
For 2-digit multiplication of two numbers, we have two cases for which our reduction method will work. [?]
Case 1.1: When first digits are same and second digits add up to 10
Case 1.2: When second digits are same and first digits add up to 10
Case 1.1
Claim: Let the numbers be a = x:y and b = x:z, then multiplication result (c) will be x*(x+1):y*z
Proof.
a = x : y = 10x + y and b = x : z = 10x + z
c = a โ b
= (10x + y) โ (10x + z)
= 100×2 + 10x โ (y + z) + yz
= 100×2 + 10x โ 10 + yz ( โต y + z = 10)
= 100x โ (x + 1) + yz
= x โ (x + 1) : yz
Note
Example 1.2.1: Let the two numbers be 66 and 64 (See Figure 1)
6 โ (6 + 1) = 42
6 โ 4 = 24
66 โ 64 = 42 : 24 = 4224
66
X 64
264
Figure 1: Long multiplication method for example 1
Pseudocode:
Algorithm 1 Vedic Multiplication: Case 1.1
1: procedure Multiply(a,b) . Where a – first number, b – second number
x = a/10 y = a%10 z = b%10 ฮฑ = x โ (x + 1) ฮฒ = yz return 100 โ ฮฑ + ฮฒ
2: end procedure . Where / is integer division
Case 1.2
Claim: Let the numbers be a = x:y and b = x:z, then multiplication result (c) will be x*y+z:z*z
Proof.
a = x : z = 10x + z and b = y : z = 10y + z
c = a โ b
= (10x + z) โ (10y + z)
= 100xy + 10z โ (x + z) + z2
= 100xy + 10z โ 10 + z2 ( โต x + y = 10)
= 100(xy + z) + yz
= xy + z : z2
Note
Example 1.2.1: Let the two numbers be 34 and 74 (See Figure 2)
3 โ 7 + 4 = 25
4 โ 4 = 16
34 โ 74 = 25 : 16 = 2516
34
X 74
136
Figure 2: Long multiplication method for example
Pseudocode:
Algorithm 2 Vedic Multiplication: Case 1.2
1: procedure Multiply(a,b) . Where a – first number, b – second number
x = a/10 y = b/10 z = a%10 ฮฑ = xy + z ฮฒ = z2 return 100 โ ฮฑ + ฮฒ
2: end procedure . Where / is integer division
Do It Mentally
1. Differentiate the case
2. Compute the two different subparts of the answer, i.e. ฮฑ, ฮฒ
3. Generate the answer by appending ฮฑ and ฮฒ (add 0 before ฮฒ if ฮฒ < 10)
Generalization
For general case, assume the numbers are (x1x2…xn) and (y1y2…yn). We can divide this into a simpler case
(with n-1 digits) using the following two cases: [?]
Condition Case Answer
x1 = y1 Case ?? x1โ (x1 + 1) : (x2x3…xn) โ (y2y3…yn)
xn = yn Case ?? (x1x2…xnโ1) โ (y1y2…ynโ1) + xn : x2n
For more details, visit this link
Reviews
There are no reviews yet.