Professional Documents
Culture Documents
Ms Data Science S, 24 (WEEK# 3) - Unlock
Ms Data Science S, 24 (WEEK# 3) - Unlock
Dr.Quratulain Rana
Assistant Professor
2
Learning Objectives
Descriptive Analytics
Probability helps summarize and describe data, revealing patterns, trends, and outliers.
Predictive Modeling
Probability distributions allow data scientists to forecast future outcomes and scenarios.
Anomaly Detection
Probability can identify unusual data points that deviate from the norm, flagging potential
errors or fraud.
Risk Assessment
Probability quantifies the likelihood and impact of risks, informing decision-making in
high-stakes situations.
Dr. Quratulain Rana
5
Meaning of the word Probability
The sample space in this scenario represents all the possible outcomes when placing the goats and the
car into the three boxes. Since the goats are indistinguishable, and we only care about the relative
placement of the goats and the car, we can denote the sample space as follows:
S = {(G1, G2, C), (G1, C, G2), (G2, G1, C), (G2, C, G1), (C, G1, G2), (C, G2, G1)}
Example:3
You roll a die. What is the space of outcomes?
Solution: 𝛀={?}
Example:4
You roll two dice. What is the space of outcomes?
Solution: 𝛀={?}
Event
An event is the favorable outcome in an experiment or Any set of outcomes is an event. Thus, events are
subsets of the sample space.
Example:5
You roll a fair four sided die. What is the probability of getting a 3?
Solution:
Example:6
You shuffle a standard deck of playing cards and draw a card. What is the probability that this is the
king?
Solution:
Example:7
You roll a fair 20 sided die. What is the probability of getting an even number?
Solution:
Example:8
You flip a fair coin three times. What is the probability of seeing HTH?
Solution:
Example:9
A computer code has no errors with probability 0.45. Find the probability that it has at least one error.
Solution:
Dr. Quratulain Rana
14
Computing Event Probabilities
Example:10
You shuffle a standard deck of playing cards and draw a card.
a) What is the probability that this is a king?
b) What is the probability that this is a heart?
c) What is the probability that this is a red card (i.e. a heart or a diamond)?
Solution:
Example:11
Based on the past experience in your repair shop, suppose the probability of a blown fuse is 6%
and the probability of a broken wire is 4%. Suppose also that you know that 1% of appliances to
be repaired come in with both a blown fuse and a broken wire. With these three pieces of
information, find the probability that an appliance has one problem or the other.
Solution:0.09
Example:12
The probability of getting a big order currently under negotiation is 0.4. The probability of losing
money this quarter is 0.5, Assume that these are mutually exclusive events. Find the probability of
getting the order or losing money.
Solution:0.9
Example:13
You remove the king of hearts from a standard deck of cards, then shuffle it and draw a card.
a) What is the probability this card is a king?
b) What is the probability this card is a heart?
Solution:
Example:14
Shuffle a standard deck of 52 cards and draw one card. The event A is “the card is a red suit” and the
event B is “the card is a 10”.
a) Are A and B independent? yes
Now we take a standard deck of cards, and remove the ten of hearts. We shuffle this deck, and draw one
card. The event C is “the card drawn from the modified deck is a red suit” and the event D is “the card
drawn from the modified deck is a 10”.
Example:15
I search a DNA database with a sample. Each time I attempt to match this sample to an entry in the
database, there is a probability of an accidental chance match of 1e -4. Chance matches are independent.
There are 20,000 people in the database. What is the probability I get at least one match, purely by
chance?
Solution:
P(match)=1e-4 So, P(no match)=1-1e-4) and n=20000
P(at least one match)=? Note
P(at least one match)=1-P(no mattch)n
= 1-(1-1e-4)20000
=1-0.14=0.86 Ans.
Example:16
Suppose that a shuttle’s launch depends on three key devices that operate independently of each other
and malfunction with probabilities 0.01, 0.02, and 0.02, respectively. If any of the key devices
malfunctions, the launch will be postponed. Compute the probability for the shuttle to be launched on
time, according to its schedule.
Solution:
Example:17
Out of six computer chips, two are defective. If two chips are randomly chosen for testing (without
replacement), compute the probability that both of them are defective.
Example:18
A computer program is tested by 3 independent tests. When there is an error, these tests will discover it
with probabilities 0.2, 0.3, and 0.5, respectively. Suppose that the program contains an error. What is the
probability that it will be found by at least one test?
Solution:0.72
Probability and Statistics for Computer Scientists, 2nd Edition, Michael Baron
Linear Algebra and Its Applications, 5th Edition, David C. Lay and Steven R. Lay
Introduction to Linear Algebra, 5th Edition, Gilbert Strang
Probability for Computer Scientists, online Edition, David Forsyth.