You are on page 1of 27

1

Lahore Garrison University


MSDS-111 Statistical and Mathematical
Methods
for Data Science
Week-3 Semester-
Spring-2024
Prepared by:

Dr.Quratulain Rana

Assistant Professor
2
Learning Objectives

After studying this lecture, the students will be able to:


 Understand the basic concepts of probability theory.
 Solve simple word problems related to random experiments and probability theory.
 Have knowledge of the laws of probability.

Dr. Quratulain Rana


3
Introduction to Probability Theory

Probability is the fundamental mathematical framework for quantifying uncertainty and


risk. It underpins the foundations of data science, enabling us to make informed decisions
in the face of incomplete information. To explore the fundamental concepts of
probability theory, We will go deeper into the principles, formulas, and applications.

Dr. Quratulain Rana


4
Applications of Probability in Data Science

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

Probability is the numeric value representing the chance, likelihood, or


possibility that a particular event will occur, such as:
 The price of a stock increasing,
 A rainy day,
 A defective product, or
 The outcome five dots in a single toss of a die.

Dr. Quratulain Rana


6
Some Important Definations
 Sample space
The sample space is the set of all outcomes, which we usually write 𝛀.
Example:1
We have three playing cards. One queen, one king and one jack. All are shown face down, and one is
chosen at random and turned up. What is the set of outcomes?
Solution: 𝛀={?}
Example:2
There are three boxes. There is a goat, a second goat, and a car. These are placed into the boxes at
random. The goats are indistinguishable for our purposes; equivalently, we do not care about the
difference between goats. What is the sample space?
Solution: 𝛀={?}

Dr. Quratulain Rana


7

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)}

Lahore Garrison University


8
Some Important Definations

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: 𝛀={?}

Dr. Quratulain Rana


9
Some Important Definations

 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.

Basic Properties of the Probability Events


 The probability of every event is between zero and one as

 Every experiment has an outcome

 The complement of an event is


Dr. Quratulain Rana
10
Some Important Definations

Basic Properties of the Probability Events

 If we have two events then:

 Two events are independent if and only if

 Two events are dependent if and only if

Dr. Quratulain Rana


11

Computing Event Probability

you can compute the probability of each outcome in an event Ƒ as:

Dr. Quratulain Rana


12
Computing Event Probabilities

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:

Dr. Quratulain Rana


13
Computing Event Probabilities

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:

Dr. Quratulain Rana


15
Computing Event Probabilities

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

Dr. Quratulain Rana


16
Computing Event Probabilities

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

Dr. Quratulain Rana


17
Computing Event Probabilities

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:

Dr. Quratulain Rana


18
Computing Event Probabilities

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”.

b) Are C and D independent?

Dr. Quratulain Rana


19

Lahore Garrison University


20

Lahore Garrison University


21
Computing Event Probabilities

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.

Dr. Quratulain Rana


22
Computing Event Probabilities

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:

Dr. Quratulain Rana


23
Computing Event Probabilities

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.

Dr. Quratulain Rana


24

Lahore Garrison University


25
Computing Event Probabilities

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

Dr. Quratulain Rana


26

Lahore Garrison University


27
References

 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.

You might also like