Mathematics For Computing
Mathematics For Computing
Part 1
𝑃(𝐴 ∩ 𝐵)
𝑃 = (𝐴/𝐵) =
𝑃(𝐵)
Example:-
A bucket contains 5 red balls and 5 blue balls. Two balls are drawn without
replacement. If the primary (first) ball is blue find the probability that the
second ball is also blue.
5
Let A be the event of drawing first blue ball. Then P(A) =
10
Let B be the event of drawing another blue ball. Now we’ve not replaced back
the first ball. So number of blue balls is 4 now and total balls are 9.
4
𝐻𝑒𝑛𝑐𝑒 , 𝑃(𝐵/𝐴) =
9
2. A Faculty which has 100 students in its sixth form, 50 students study
mathematics, 29 study biology and 13 study both subjects. Find the
probability of the scholar studying mathematics given that the student
studies biology.
S=100
50 29
37 13 16
B
A 34
𝑃(𝑀 ∩ 𝐵)
𝑃(𝑀⁄𝐵) =
𝑃(𝐵)
13 100
= ×
100 29
13
=
29
3. A specific medical disease occurs in 1% of the population. An easy
screening procedure is available and in 8 out of 10 cases where the patient
has the disease, it produces a positive result. If the patient doesn’t have
the disease there is still a 0.05 chance that the test will provides a positive
result. Find the probability that a randomly selected individual:
(a) Doesn’t have the disease but gives a positive result in the screening test
5
𝑃(𝑠⁄𝑐′) =
100
′
𝑃(𝑐 ∩ 𝑠) = 𝑃(𝑠⁄𝑐′) × 𝑃(𝑐′)
5 99
= ×
100 100
495
=
10000
𝑃(𝑐 ∩ 𝑠)
𝑃(𝑐⁄𝑠) =
𝑃(𝑠)
𝑃(𝑠⁄𝑐 )𝑃(𝑐)
𝑃(𝑠)
8 1
×
10 100
8
1000
(a) Find the probability that the scholar either drives to college or has a graphics
calculator.
S=15
4 1 2
G
H
2
D 6
𝑃(𝐴 ∩ 𝐵)
𝑃(𝐴⁄𝐵) =
𝑃(𝐵)
𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐴⁄𝐵) 𝑃(𝐵)
𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐴) × 𝑃(𝐵)
𝑃(𝐺 ∩ 𝐻) = 𝑃(𝐺) × 𝑃(𝐻)
1
𝑃(𝐺 ∩ 𝐻) =
5
5 3
𝑃(𝐺) × 𝑃(𝐻) = ×
15 15
1
=
15
If the probability of G & H are independent there should be equal to 𝑃(𝐺 ∩ 𝐻).
5. A bag contains 6 blue balls, 5 green balls and 4 red balls. Three are
selected at randomly without replacement. Find the probability that
(a) they’re all blue
(b) two are blue and one is green
(c) there’s one of each colour
4
13 5
13 4
B 13 5
13 4
B 13 4
13
5
5 B
B 13
14 5
5 13 5
14 13
4 5
B
14 13
4
6 6
13
15 B 14 B 4
6 13
5 4 B
133
15 G 14
4 13 4
4
15 R 13
14 B 6
6 13
5 14 B
3
14 B 13 5
3
3 5 13
14
13 13
6
4
B 13
3 13
6 13
5 13
2 13
13
(a) 𝑃(𝐵1 ∩ 𝐵2 ∩ 𝐵3 )
6 5 4 120
× × =
15 14 13 2730
6 5 5 6 5 3 5 6 5 450
b) ( × × )+( × × )+( × × ) =
15 14 13 15 14 13 15 14 13 2730
6 5 4 6 4 5 5 6 4 5 4 6 4 6 5
a) (15 × 14 × 13) + (15 × 14 × 13) + (15 × 14 × 13) + (15 × 14 × 13) + (15 × 14 × 13) +
4 5 6 700
(15 × 14 × 13) = 2730
Part 2
Discrete Continuous
Can counting Can Measure
Use probability Mass Function Probability Density function
P(X=x) F(X ≤ 𝑥)
Variable whose value is obtained by Variable whose value is obtained by
counting. measuring.
can take only distinct, separate values can take any value in some interval
Table 1: Differentiate of Discrete & Continuous
7. Two fair cubical dice are thrown: one is red and one is blue. The random
variable M represents the score on the red die minus the score on the blue
die.
(a) Find the distribution of M.
M= The score on the red die minus the score on the blue die
M= -5 to 5
Blue Die
1 2 3 4 5 6
1 0 -1 -2 -3 -4 -5
Red Die
2 1 0 -1 -2 -3 -4
3 2 1 0 -1 -2 -3
4 3 2 1 1 -1 -2
5 4 3 2 2 0 -1
6 5 4 3 3 1 0
Table 2:Table of Probability
The Probability Discrete of M
M -5 -4 -3 -2 -1 0 1 2 3 4 5
P(M=m) 1 2 3 4 5 6 5 4 3 2 1
36 36 36 36 36 36 36 36 36 36 36
𝐸(𝑀)2 = ∑ 𝑚2 𝑃(𝑀 = 𝑚)
1 2 3 4 5
[(−5)2 × ] + [(−4)2 × ] + [(−3)2 × ] + [(−2)2 × ] + [(−1)2 × ]
36 36 36 36 36
6 5 4 3 2
+ [(0)2 × ] + [12 × ] + [22 × ] + [32 × ] + [42 × ]
36 36 36 36 36
2
1
+ [5 × ] = 5.824
36
Coin 1
Head Tail
Head
20 10
Coin 2
Tail
10 0
X 0 10 20
P(X=x) 1 2 3
4 4 4
𝐸(𝑋) = ∑ 𝑥 × 𝑝(𝑋 = 𝑥)
1 2 1
= 0 × + 10 × + 20 ×
4 4 4
= 10
1
𝑆 = 𝑋 − 10 𝑡 = ( ) × −5
2
𝐸(𝑆) = 𝐸(𝑋 − 10)
= 𝐸(𝑋) − 𝐸(10)
= 10 − 10
=0
1
𝐸(𝑇) = 𝐸 [( ) × −5]
2
1
= 𝐸 [( ) 𝑋] − 𝐸(𝑆)
2
1
= ( ) 𝐸 (𝑥) − 5
2
1
= × 10 − 5
2
=5−5
=0
1
𝑉𝑎𝑟(𝑇) = 𝑉𝑎𝑟 [( ) × −5]
2
1
= 𝑉𝑎𝑟 [( ) 𝑥] − 𝑉𝑎𝑟 (5)
2
2
1
= ( ) 𝑉(𝑋) − 0
2
1
= × 50
4
= 12.5
(d) Susan and Thomas play a game using two 10p coins. The coins are tossed
and Susan records her score using the random variable S and Thomas uses
the random variable T. After a large number of tosses they compare their
scores. Comment on any likely differences or similarities.
where k is a constant.
∑ 𝑃 (𝑋 = 𝑥) = 1
Therefore;
𝑃(𝑋 = 1) + 𝑃(𝑋 = 2) + 𝑃(𝑋 = 3) + 𝑃(𝑋 = 4) = 1
1 1 1
+ +𝐾+ =1
3 3 4
1 1 1
𝐾 =1−( + + )
3 3 4
0.09
X 0 1 2 3 4 5
No of Batch 95 113 87 64 13 8
95 113 87 64 13 8
P(X=x)
380 380 380 380 380 380
1
= 95 + 113 + 174 + 102 + 62 + 40
380
1 586
=
380 1
1.49
(c) Find the variance and standard deviation of this probability distribution.
i. 𝑉(𝑋) = 𝐸(𝑥 2 ) − [𝐸(𝑥)]2
= 3.73 − (1.49)2
= 1.51
i. 𝑆𝐷(𝑋) = √𝑉(𝑥)
= √1.51
= 1.23
11. A surgery has a success rate of 75%. Suppose that the surgery is
performed on three patients.
(a) What is the probability that the surgery is successful on exactly 2
patients?
= 0.422
(b) Let X be the number of successes. What are the possible values of X?
P(X=x) = 3Cx (0.75)x (1-0.75)3-x
X 0 1 2 3
P(X=x) 0.016 0.141 0.422 0.422
(d) Graph the probability distribution for X using a histogram.
0.45
0.4
0.35
Probability P(X=x)
0.3
0.25
0.2
0.15
0.1
0.05
0
0 1 2 3
Number of Successes (X=x)
Variance of a Binomial
Distribution = 𝜇 = 𝑛𝑝 𝑛 = 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑡𝑟𝑖𝑎𝑙𝑠 𝑝 = 𝑃𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑦 𝑜𝑓 𝑆𝑢𝑐𝑐𝑒𝑠𝑠
𝜇 =𝑛×𝑝
= 3 × 0.75
= 2.25
n= Number of trials
p=Probability of success
q=probability of failure
(c) What is the variance and standard deviation of the number of days with rain
in November?
N= 18
26
P = 26% = = 0.26
100
18
P(X=x) = Cx (0.26)x (1-0.26)18-x ;
Mean of x;𝜇 = 𝑛 × 𝑝
= 18 x 0.26
= 4.68
(c) Find the variance and standard deviation of the number of customers
who make a purchase.
ii. SD of X; 𝜎 = √𝑛𝑝𝑞
= √3.46
= 1.86
14. On a recent math test, the mean score was 75 and the standard deviation
was 5. Shan got 93.Would his mark be considered an outlier if the marks
were normally distributed? Explain.
X=93 𝜎 = 5 𝜇 = 75
-3 +3
𝑥−𝜇
𝑍= 𝜎
93 − 75
𝑍=
5
18
=
8
= 3.6
15. For each question, construct a normal distribution curve and label the
horizontal axis and answer each question.
The shelf life of a dairy product is normally distributed with a mean of 12
days and a standard deviation of 3 days.
(a) About what percent of the products last between 9 and 15 days?
9 ≤ 𝑥 ≤ 15 𝑏𝑦 𝑠𝑡𝑎𝑛𝑑𝑎𝑙𝑖𝑧𝑖𝑛𝑔
9−𝜇 𝑥 − 𝜇 15 − 𝜇
≤ ≤
𝜎 𝜎 𝜎
9 − 12 15 − 12
≤ 𝑍 ≤
3 3
(b) About what percent of the products last between 12 and 15 days?
12 ≤ 𝑥 ≤ 15 𝑏𝑦 𝑠𝑡𝑎𝑛𝑑𝑎𝑙𝑖𝑧𝑖𝑛𝑔
12 − 𝜇 𝑥 − 𝜇 15 − 𝜇
≤ ≤
𝜎 𝜎 𝜎
12 − 12 15 − 12
≤ 𝑍≤
3 3
0 ≤ 𝑍 ≤ +1
𝑥 ≤ 6 𝑏𝑦 𝑠𝑡𝑎𝑛𝑑𝑎𝑙𝑖𝑧𝑖𝑛𝑔
𝑥−𝜇 6−𝜇
≤
𝜎 𝜎
6 − 12
𝑧 ≤
3
𝑧 ≤ −2
2 ≤ −2
2.35% + 0.15%
2.5%
= 4.538
𝑥−𝜇 99 − 𝜇
𝑃 [ > ]
𝜎 𝜎
99 − 93.6
𝑍 >
4.538
The hash is an algorithm that calculates a fixed-length bitrate from a file. The file
basically contains datasets. Hashing converts this data into a very short length of
a fixed length or key that represents the original text. The gash value can be
summarized in the file.
In addition to load balancing, there are Hands Tones. The key you need to hashing
is that you have a well-functioning algorithm when the input data is random. This
is a clickable and additional algorithm, the creation of data structure and analysis,
and in many other places.
A good choking algorithm also shows a moving property. As a result, the hash
output will be significant or completely different. Each bit or data bit change in a
file varies. This has not been considered a hash function, which is considered to
have a weaker vibe, which would be easy to break by hackers.
The freight specialist acts as "traffic police" in front of his clients. The clients'
requests are fulfilled at maximum efficiency and at maximum efficiency and
speed. If one server drops, the load balancer redirects traffic to the remaining
Internet servers.
(Hasing and load balancing - Standford University , n.d.)