logo

Maths for Computing: Number Theory, Probability, Geometry, and Calculus

   

Added on  2024-05-21

27 Pages4264 Words436 Views
 | 
 | 
 | 
Maths for Computing
0
Maths for Computing: Number Theory, Probability, Geometry, and Calculus_1

Table of Contents
LO1 Use applied to number theory in practical computing scenarios............................................2
[P1] Number theory...................................................................................................................2
[P2] sequences and Series......................................................................................................... 7
M1............................................................................................................................................. 8
LO2 Analyze events using probability theory and probability distributions................................10
[P3] Probability theory.............................................................................................................10
[P4] Probability Distributions...................................................................................................13
M2............................................................................................................................................14
LO3 Determine solutions of graphical examples using geometry and vector methods................15
[P5] Geometry......................................................................................................................... 15
[P6] Vectors............................................................................................................................. 21
M3............................................................................................................................................22
LO4 Evaluate problems concerning differential and integral calculus.........................................23
[P7] Differential calculus..........................................................................................................23
[P8] Integral calculus................................................................................................................25
M4............................................................................................................................................26
Reference:.................................................................................................................................... 26
1
Maths for Computing: Number Theory, Probability, Geometry, and Calculus_2

LO1 Use applied to number theory in practical computing scenarios
[P1] Number theory
1.1. Convert the decimal 5613.9062510 into Binary number, Binary number via octal
Department of Information Technology and Hexadecimal
Binary conversion
5613
2 5613
2 2806 1
2 1403 0
2 701 1
2 350 1
2 175 0
2 87 1
2 43 1
2 21 1
2 10 1
2 5 0
2 2 1
2 1 0
1
0.9062510
2
0.9062510*2 1. 812502 1
0.812502*2 1. 625004 1
0. 625004*2 1.2250008 1
0.250008*2 0.500016 0
0.500016*2 1. 000032 1
0.000032*2 0.000064 0
0.000064*2 0.000128 0
0.000128*2 0.000256 0
Maths for Computing: Number Theory, Probability, Geometry, and Calculus_3

5613.9062510 binary conversions are 1010111101101. 11101000
Binary number via octal
5613
8 5613
8 701 5
8 87 5
8 10 7
8 1 2
1
0.9062510
5613.9062510 octal conversions are 12755.72000
Octal Number binary representation is
Octal Number Binary Number Octal Number Binary Number
0 000 4 100
1 001 5 101
2 010 6 110
3 011 7 111
Octal Number Binary conversion
12755 1010111101101
72000 0.11101000
12755.72000 octal number binary conversion is (1010111101101. 11101000)2
3
0.9062510*8 7.250008 7
0.250008*8 2.000064 2
0.000064*8 0.000512 0
0.000512*8 0.004096 0
0.004096*8 0.032768 0
Maths for Computing: Number Theory, Probability, Geometry, and Calculus_4

Hexadecimal conversion
5613
16 5613
16 350 D (13)
16 21 E (14)
16 1 5
1
0.9062510
16*0.9062510 14.500016 E
16*0.500016 8.000256 8
16*0.000256 0.004096 0
16*0.004096 0.065536 0
16*0.065536 1 .048576 1
5613.9062510 Hexadecimal conversions are 15ED.E8001
1.2. Demonstrate by example how you would find the GCD and the LCM of any two
numbers and provide a Python code for both algorithms. You must provide the code and a
screenshot of the output of the program.
Find GCD the given two numbers (Python code)
def findgcd(x,y):
if(y==0):
return x
else:
return findgcd(y,x%y)
4
Maths for Computing: Number Theory, Probability, Geometry, and Calculus_5

x=int(input("input first number:"))
y=int(input("input second number:"))
GCDValue=findgcd(x,y)
print("GCD of two number is: ")
print(GCDValue)
******************************************************************************
*****
******************************************************************************
***********
Figure 1: GCD Python code output
Find LCM the given two numbers (Python code)
def findlcm(x,y):
x=int(input("input first number:"))
y=int(input("input second number:"))
if(x>y):
minimum=x
else:
minimum=y
while(1):
5
Maths for Computing: Number Theory, Probability, Geometry, and Calculus_6

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents