Maths for Computing: Application of Mathematics in Information Technology, Study notes of Mathematics

A comprehensive study on the application of mathematics in information technology, focusing on number theory, diophantine equations, geometric progressions, and probability theory. Topics covered include the euclidean algorithm, diophantine equations, geometric progressions, and the sum of infinite terms, as well as the multiplicative inverse, bayes' theorem, and the probability of having a virus. The document also covers continuous random variables, linear algebra, and optimization problems.

Typology: Study notes

2023/2024

Uploaded on 03/25/2024

sophie-ella
sophie-ella 🇲🇲

1 document

1 / 82

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ThinZar Phyo Wai Unit 14: Maths for Computing Batch-102
HNC
Un it 14: Math For Computing
Application of Mathematics in Information Technology
1
Info Myanmar University
ThinZar Phyo Wai
Batch – 102
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52

Partial preview of the text

Download Maths for Computing: Application of Mathematics in Information Technology and more Study notes Mathematics in PDF only on Docsity!

HNC

Unit 14: Math For Computing

Application of Mathematics in Information Technology

Info Myanmar University

ThinZar Phyo Wai

Least Common Multiple

The least common multiple is the smallest multiple that two or more numbers which can be

exactly divided by each of the given number.

lcm ( a , b , c )= P

1

max ( a 1 ,

b 1 ,

c 1

)

⋅ P

2

max ( a 2 ,

b 2 ,

c 2

)

⋅… ⋅ P

n

max ( a n,

b n,

c n

)

Example: Find the LCM of 20,50 and 60?

Solution:

20 = 2 × 2 × 5
50 = 2 × 5 × 5
60 = 2 × 2 × 3 × 5

lcm ( a , b , c )= P

1

max (

a

1 ,

b

1 ,

c

1

)

⋅ P

2

max (

a

2 ,

b

2 ,

c

2

)

⋅… ⋅ P

n

max (

a

n,

b

n,

c

n

)

lcm

max (2,1,2)

max (1,2,1)

max ( 0,0,1)

2

× 5

2

× 3

1

¿ 4 × 25 × 3

Therefore, lcm (20, 50,60) = 300

Greatest Common Divisor

The Greatest Common Divisor (GCD) refers to the largest number that is a common divisor for a

given set of numbers. The GCD is useful for simplifying and comparing fractions, and solving

and simplifying equations. The equation of greatest common divisor is given below.

gcd ( a ,b , c ) = P

1

min (

a

1

,b

1

, c

1

)

⋅ P

2

min (

a

2

, b

2

,c

2

)

⋅…⋅ P

n

min (

a

n

,b

n

,c

n

)

Example: What is the greatest common divisor of 45 and 30?

Solution:

45 = 3 × 3 × 5
30 = 2 × 3 × 5

gcd ( a ,b , c ) = P

1

min (

a

1

,b

1

, c

1

)

⋅ P

2

min (

a

2

, b

2

,c

2

)

⋅… ⋅ P

n

min (

a

n

,b

n

,c

n

)

gcd

min (0,1 )

min (2,1 )

min (1,1 )

0

× 3

1

× 5

1

Therefore , gcd (45,30)= 15

P1: (a) Question

P1: (a) Three traffic lights at three different crossings changes after 50 seconds, 1 minute 12

seconds and 1 minute 54 seconds respectively. There are occasions when all three traffic

lights will turn red simultaneously. If they all change simultaneously at 3:00, find the next

time when they will change simultaneously again.

P1: (a) Solution

L

one

= 50 sec

L

two

= 1 min 12 sec =( 60 + 12 ) sec = 72 sec

2624 = 1 × 2224 + 400
2224 = 5 × 400 + 224
400 = 1 × 224 + 176
224 = 1 × 176 + 48
176 = 3 × 48 + 32
48 = 1 × 32 + 16
32 = 2 × 16 + 0

∴ gcd ( 2624,7472)= 16

Explanation:

Want to find gcd of (2624,7472) by using the Euclidean Algorithm, it is more efficient method to

calculate the gcd of two numbers. Euclidean Algorithm use division algorithm where we get a

quotient and remainder and the last non-zero remainder will be the gcd. In above sum, by taking

the bigger number 7472 and dividing it by smaller number 2624. 2624 multiply into the quotient

two and add the remainder 2224 and solving step by step to reach the remainder zero. Finally,

the non-zero remainder

be the result of this question.

Background Theory

Euclidean Algorithm

Euclidean Algorithm is used to find the GCD (Greatest Common Divisor) of two positive

integers a and b.

gcd ( a ,b )= sa + tb

Euclidean Algorithm using pseudo code

Here is the example of pseudo code for a Euclidean Algorithm,

c ≤ EUCLID ( a , b )

Inputs a , b : integers witha ≥ b ≥ 0 ,a! = 0

Output d : gcd ( a , b )

u = a ;v = b ;

while ( v > 0 )

r = u mod v ;

u = v ; v = r ;

d = u

Example: Use Euclidean Algorithm to find GCD (111, 201)

Solution:

201 = 111 × 1 + 90
111 = 90 × 1 + 21
90 = 21 × 4 + 6
21 = 6 × 3 + 3
6 = 2 × 3 + 0

Therefore, GCD ( 111 , 201 )= 3

Bezout’s Theorem

Bezout’s Theorem is also called as Extended Euclidean Algorithm. It is an extension of the

Euclidean Algorithm that computes the greatest common divisor (GCD) of integers a and b.

GCD is the largest integer that divides both a and b without any remainder and also find s and t

by using back substitutions.

gcd ( a ,b )= sa + tb

¿ 9 × 2224 − 45 × 400 − 5 × 400
¿ 9 × 2224 − 50 × 400

¿ 9 × 2224 − 50 × [ 2624 − 1 × 2224 ]

¿ 9 × 2224 − 50 × 2624 + 50 × 2224
¿ 59 × 2224 − 50 × 2624

¿ 59 × [ 7472 − 2 × 2624 ]− 50 × 2624

¿ 59 × 7472 − 118 × 2624 − 50 × 2624
¿ 59 × 7472 − 168 × 2624

gcd ( 7472,2624 )= 59 × 7472 − 168 × 2624

Compare with 7472 x + 2624 y = gcd ( 7472,2624)

∴ x = 59 , y =− 168

Explanation:

Want to find out Bezout's coefficients x and y, the first step is need to apply Euclidean

Algorithm to calculate the greatest common divisor of 7472 and 2624. By solving the problem,

use the backward substitution technique to obtain the standard form of Bezout's theorem. The

final step is comparing with the Bezout's theorem and get the values of x and y. The values of x,

y is (x=59 and y = -168), respectively.

P2: (a) Solution

Leonard is saving money ¿ buy penthoouse =250,260,270,280 , ...

a

1

a

2

a

1

a

3

a

2

Above sequence 250,260,270 has same common difference that is why it is an arithmetic

progression.

d = 10

a

n

= a

1

+( n − 1 ) d

a

12

The amount he save on one year = $ 360

At the end of 4 year = 4 × 12 = n = 48 months

S

n

n

[

2 a +( n − 1 ) d ]

S

48

[

]

¿ 24 [ 500 + 470 ]

¿ 24 [ 970 ]

The total amount at the end of 4 year = $ 23280

( iii ) Four year after saving money ¿ buy a car = S

48

d = 18

a =?

S

n

n

[

2 a +( n − 1 ) d ]

S

48

[

2 a +( 48 − 1 ) 18 ]

23280 = 24 [ 2 a + 846 ]

=[ 2 a + 846 ]

S

n

n

[ a + l ]

l = last term

Example: Mr. Kevin earns $400,000 per annum and his salary increases by $50,000 per

annum. Then how much does he earn at the end of the first 3 years?

Solution:

The amount earned by Mr. Kevin for the first year is, a = 4,00,000.

The increment per annum is, d = 50,000.

We have to calculate his earnings in the 3 years. So, n = 3.

Substituting these values in the AP sum formula,

S

n

n

[

2 a +( n − 1 ) d ]

S

3

[ 2 ( 400000 )+( 3 − 1 ) 50000 ]

[

]

He earned $ 1350000 ∈ 3 years.

S

n

a

r n

r − 1

n

n

n

log 2 n =log 1032385 n log 2 =log 1032385 n = log 1032385 log 2 ¿ ln 2

∴ Justin answered 20 questions. Explanation: In above sum, contestants are winning by answer questions. First questions for $15, second for $30, the third for $ 60. So, the sequence 15,30,60 has common ratio. It is a GP_._ By using the sum of infinite terms, we can get the number of questions correctly. Background Theory Geometric Progression Geometric Progression are ordered sets of numbers that process by multiplying or dividing each term by the same amount each time this amount is common ratio. The formula for the nth term of a geometric progression whose first term is a and common ratio is a n = a r n − 1

The sum of infinite terms when |r|<1;

S

n

a ( 1 − r

n

( 1 − r )

The sum of n terms when r ≠ 1;

S

n

a ( r

n

( r − 1 )

Example- 3 The number 2048 is which term in the following Geometric sequence 2, 8,

Solution:

a = 2 ∧ r = 4

n

th

term GP is a

n

= a r

n − 1

2048 = 2 × 4

n − 1

n − 1

5

n − 1

5 = n − 1

n = 6

M1: Solution

(a) gcd ( 34,89 )

89 = 2 × 34 + 21
34 = 1 × 21 + 13
21 = 1 × 13 + 8
13 = 1 × 8 + 5
8 = 1 × 5 + 3

x = 77 × (− 34 )

x =− 2618

x ≡ 52 ( mod ) 89

∴ x = 52

( b ) E ( x ) 7 x + 12 ( mod 26 )

E ( x ) 7 x ( mod 26 )+ 12 ( mod 26 )

E ( x ) 7 x ( mod 26 )+ 12

E ( x )− 12 7 x ( mod 26 )

Change the decrypted message(D(x))

− 1

x − 12

mod 26

≡ D ( x )

15 ( x − 12 ) ( mod 26 ) ≡ D ( x )

Enciphered message 8,16, 25, 2 to decrypted message,

D ( x )= 15 ( 8 − 12 ) mod 26 =− 60 ( mod 26 )= 18 =¿ S

D ( x )= 15 ( 16 − 12 ) mod 26 = 60 ( mod 26 ) = 8 =¿ I

D ( x )= 15 ( 25 − 12 ) mod 26 = 195 ( mod 26 )= 13 =¿ N

D ( x )= 15 ( 2 − 12 ) mod 26 =− 150 ( mod 26 )= 6 =¿ G

The decrypted message is SING.

Background Theory

Linear Congruence

The congruence of

ax ≡b ( mod m ) is called Linear Congruences modulo n.

Where; a and b are integers, m is a positive integers and x is a variable of the congruence.

Multiplicative Inverse

The Multiplicative Inverse is the inverse of the given number that can be written by x

− 1

and

another way it is also called as the reciprocal of x.

Example: What is the multiplicative inverse of 22?

The reciprocal of 22 is

− 1

So, we can calculate

22 ×

The multiplicative inverse of 22 is 1.

Cryptography

Cryptography provide techniques for securing information, storing and transmitting data in a

particular form, ensuring that only the person who is intended to see the information. In

mathematics, cryptography translates hidden writing and includes two methods, Encryption and

Decryption. Encryption means secreting data message and Decryption means changing data to

original message.

The encryption formula is f ( p ) = p + 3 ( mod 26 )

The decryption formulais f

− 1

( p ) = p − 3 ( mod 26 )

Affine Encipher

Affine Encipher of each letter in an alphabet is mapped to its numeric equivalent, encrypted

using with a simple mathematical function, transformed back to a letter.

The formula of Affine Encipher is given by;

E ( x ) ( ax + b ) mod 26

Explanation:

M1(a) The gcd of (34,89) is 1. Therefore, the inverse of 34 mod 89 exists and using backward

substitution method. The next step is to compared with Bezout's theorem and the get the value

(the inverse of 34 mod 89 is-34). Substituting -34 to the equation

34 x ≡ 77 ( mod 89 ) and get the

value of x=52.