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

Verified

Added on  2024/05/21

|27
|4264
|436
Homework Assignment
AI Summary
This assignment solution covers various topics in Maths for Computing, including number theory (decimal to binary conversion, GCD, LCM), sequences and series (cost estimation, depreciation), probability theory (component failure, battery selection), probability distributions (coin toss probabilities), geometry (Cartesian to polar coordinate conversion), vector methods, and calculus (differential and integral calculus). Python code examples for GCD and LCM are provided with screenshots of the output. The assignment also includes calculations and explanations for real-world problems, such as estimating the cost of boring a hole and determining the depreciation of an industrial machine. The document illustrates the application of mathematical concepts in practical computing scenarios.
Document Page
Maths for Computing
0
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
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
Document Page
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
Document Page
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
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
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
Document Page
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
Document Page
if(minimum%x==0 and minimum%y==0):
print("LCM ",minimum)
break
minimum=minimum+1
Figure 2: LCM Python code output
6
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
[P2] sequences and Series
1.3. An oil company bores a hole 100m deep. Estimate the cost of boring if the cost is £50
for drilling the first meter with an increase in the cost of £5 per meter for each succeeding
meter
Cost of the first meter is = £50
Increase the cost with each meter is = £5
Then the cost of the second meter is = £55
Cost of the third meter is = £60
Then their make Sequence for the 100-meter cost
50, 55, 60, 65… Cost of 100-meter cost
Total cost is Sn = n
2 [2 a+ ( n1 ) d ]
Where N is number of steps
A is an initial cost
D is the difference between costs
Sn = 100
2 [250+(1001)5]
= 50 [100+ 99*5]
= 29750
Therefore, Estimate the boring cost is £29,750 (Mike and Estela,2014)
1.4. An industrial machine originally valued at £30,000 when brand new depreciates at a
rate of 12% per annum. Based on this data, answer the following questions.
a) Calculate its value after 5 years.
b) The company policy is to sell the machine when its value drops below 5000. After how
many years will the machine be sold?
Originally value of industrial Machine is = £30000
7
Document Page
New depreciates rate for machine= 12%
A) Final Value= ActualValue [1 ± R
100 ]
T
= 30000[1 12
100 ]
5
=30000* 0.88* 0.88* 0.88* 0.88* 0.88
= 15831.96
After the end of 15 year the value of the machine will be dropped to 4409.27
B) 5000 = 30000[1 12
100 ]
T
1
6 = 0.88T
T= 15 (almost)
After the 15 years, machine value is below 5000.
M1
A shop owner receives 40 boxes of bottled water in one delivery. Each box contains 110
bottles of water. The shop owner plans to pack the bottles into cases of 12 to sell. After
making as many complete cases as possible, how many bottles will be leftover? You must
use modular arithmetic to give your answer
Total Number of water bottle boxes is = 40
One box contain = 110 water bottles
Then 40 box contain = 110 * 40 water bottles
= 4400 water bottles
Shopper want to sell 12 water bottles in one pack
Apply Modular Arithmetic to calculated total pack and reaming water bottles
A= (overall water bottles) % (one pack water bottles)
8
Document Page
Here, A is the mod of (overall water bottles) to (one pack water bottles)
B represents the left water bottles left
B = A × (one pack water bottles)/100
A= Mod (4400%12)
= 67
Y = 67 × 12 /100
= 8
Therefore, 8 water Bottles are left
9
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
LO2 Analyze events using probability theory and probability distributions
[P3] Probability theory
2.1 The probability of a component failing in one year due to excessive temperature is 0.05,
due to excessive vibration is 0.04 and due to excessive humidity is 0.02. Determine the
probabilities that during a one-year period a component: (a) fails due to excessive
temperature and excessive vibration (b) fails due to excessive vibration or excessive
humidity, and (c) will not fail because of both excessive temperature and excessive
humidity.
Component failing in one year due to excessive temperature, vibration and humidity,
P (Humidity) = 0.02
P (Temperature) = 0.05
P (Vibration) = 0.04
a) here, calculated the probability P(A)
P(A) refers as the probability occur Fail due to excessive vibration and excessive
temperature
P(A) = P (Vibration) * P (Temperature)
= 0.04 * 0.05
= 0.002
b) here, calculated the probability P(B)
P(B) refers as the probability occur Fail due to excessive humidity and excessive
vibration
P(B) = P (Vibration) + P (Humidity)
= 0.04 + 0.02
= 0.06
c) here, calculated the probability P(M)
P(M) refers as the probability occur Not fail due to both excessive humidity and
excessive temperature
10
Document Page
P’ (Temperature) = 1- P (Temperature)
= 1 - (0.05)
= 0.95
P’ (Humidity) = 1- P (Humidity)
= 1 – (0.02)
= 0.98
P (N) = P’ (Temperature) × P’ (Humidity)
= 0.95 × 0.98
= 0.931
2.2- A batch of 50 mobile phone batteries contains 31 that are within the required tolerance
value, 8, which are below the required tolerance values. determine the probability that
when randomly selecting a battery and then a second battery (a) both are within the
required tolerance values when selecting with replacement, and (b) the first one drawn is
below and the second one drawn is above the required tolerance value, when selection is
without replacement.
Number of mobile phone batteries = 50
Number of mobile phone batteries with the required tolerance value = 31
Number of mobile phone batteries with the below tolerance value = 8
Number of mobile phone batteries with the above tolerance value = 11
P(Required tolerance value) = Possible Result
Overall outcome
= 31
50
= 0.62
a) Here, calculated the Probability P(A) which referred as of both the mobile phone
batteries with the required tolerance value is:
P (A) = P(Required tolerance value) * P(Required tolerance value)
= 0.62 * 0.62
= 0.3844
11
chevron_up_icon
1 out of 27
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]