You are on page 1of 18

Statistics and Random Variables

KINPOE
Karachi Institute of
Power Engineering

Dr. Adeel Abbas


adeel.abbas@paec.gov.pk
Probability

How likely something is to happen


 Tossing a coin – two possible outcomes
 Probability of heads (H) – ½
 Probability of tails (T) – ½

 Rolling a die – six possible outcomes


 1, 2, 3, 4, 5 or 6
 Probability of any one – 1/6
 In general
Number of ways it can happen
Probability of an event happening =   Total number
of outcomes

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 2


Probability Line

 Probability is always between 0 and 1


 Probability is Just a Guide – does not tell exactly what will
happen
Example: toss a coin 100 times, how many Heads
will come up?
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 3
Special Words
Some words have special meanings in Probability
 Experiment – an action where the result is uncertain
Tossing a coin, throwing dice, seeing what pizza people choose
 Sample space – all the possible outcomes of an experiment
 Choosing a card from a deck, means sample space is all 52 cards
 The sample space is made up of Sample Points
 Sample point – just one of the possible outcomes
 The 5 of clubs and the king of hearts are the sample points
 "King" is not a sample point, as there are 4 kings (i.e. 4 sample points)
  Event – a single result of an experiment
 Getting a tail when tossing a coin, and rolling a "5" are the events
 An event can include one or more possible outcomes
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 4
Special Words – Example
Fahad decides to see how many times a "double" would come up while
throwing 2 dice
 Each time Fahad throws the 2 dice is an Experiment because the result
is uncertain.
 The Event Fahad is looking for is a "double", where both dice have the
same number. It is made up of these 6 Sample Points:
{1,1} {2,2} {3,3} {4,4} {5,5} and {6,6}
 The Sample Space is all possible outcomes (36 Sample Points):
{1,1} {1,2} {1,3} {1,4} ... {6,3} {6,4} {6,5} {6,6}
 These are Fahad’s results: {3,4} No {5,1} No {2,2} Yes {6,3} No ... ...
 After 100 Experiments, Fahad had 19 "double" Events ... is that close
to what you would expect? (Probability: 0.167 & Actual: 0.19)
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 5
Basic Counting Principle
If m ways to do one thing and n ways to do another, then there are
m×n ways of doing both
Example – Buying a new car
 2 body styles –
 5 colors –
 3 models – GL, SS, SL
Total
Choices
Choices
= 5× =32+
×45×3
What if the events are *only for
= 15 =
+ 30
12 = 27
dependent? independent events

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 6


Types of Events
Event means one (or more) outcome(s)
 Independent events
 Each event is not affected by any other events
 Tossing a coin multiple times – isolated events
 Probability of three heads in a row? And for seven?
 P(A and B) = P(A) × P(B)
Example: You want to go to a concert, which is some time on the weekend
between 4 and 12. You can only attend if it is on Sunday between 10 and
12, what is the chance that you attend the entire concert?
 Day: there are two days on the weekend, so P(Sunday) = 0.5
 Time: between 4 and 12 is 8 hours, but you want between 10 and 12
which is only 2 hours, so P(Time) = 2/8 = 0.25
 Finally: P(Sunday and Time) =P(Sunday)×P(Time)=0.5×0.25= 0.125
 Or a 12.5% chance
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 7
Types of Events
 Dependent events
 An event can be affected by any other event(s)
 Drawing two cards from a deck without replacement
 Dependent events => conditional probability
 Conditional probability – tree diagram
Example: Bag contains 2 blue and 3 red marbles. What are the
chances of drawing 2 blue marbles?
 Tree diagram

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 8


Notations
We love notations in mathematics!
 P(A) – Probability of event A
 P(B|A) – Probability of event B given event A (i.e. conditional probability)

Probability of event A and event B equals the probability of event A


times the probability of event B given event A”
 Finding hidden data

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 9


Mutually Exclusive Events
Can’t happen at the same time
 Turning left and right, tossing a coin,
kings and aces, etc. √
 Turning left and scratching your
head, kings and hearts, etc. Χ
 P(A and B)=0 – the probability of A
and B together equals 0 (impossible)
 P(A or B)=P(A) + P(B) – the probability of A or B equals the
probability of A plus the probability of B
 Special notations
 P(A and B)=> P(A ∩ B)
 P(A or B)=> P(A ∪ B)

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 10


Not Mutually Exclusive Events
P(A ∪ B) = P(A) + P(B) - P(A ∩ B)
Example: Hearts or Kings
 Hearts and Kings together is only King of Hearts
 Hearts or Kings is
 All the Hearts (13 of them)
 All the Kings (4 of them)
 But that counts the King of Hearts twice!
 Answer is corrected by subtracting the extra "and" part

16 Cards = 13 Hearts + 4 Kings - the 1 extra King of Hearts


P(Hearts ∪ Kings) = P(Hearts) + P(Kings) - P(Hearts ∩ Kings)
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 11
Summary
 Mutually exclusive
 A and B together is impossible
P(A and B) = 0
 A or B is the sum of A and B
P(A or B) = P(A) + P(B)
 Not mutually exclusive Assignment #4!!!
 A or B is the sum of A and B minus A and B
P(A or B) = P(A) + P(B) - P(A and B)
 Practice problem
16 people study French, 21 study Spanish
and there are 30 altogether. Work out the
probabilities!
Can you extend this to three or more events???
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 12
Combinations and Permutations
 What's the Difference?
 Combination – order doesn't matter (fruit salad combination)
 Permutation – order does matter (PIN code of an ATM card)

Permutation is an ordered Combination

 Permutations
 Repetition is allowed – PIN code of an ATM
 No repetition – first three people in a running race

 Combinations
 Repetition is allowed – coins in your pocket (2, 2, 2, 5, 5, 1, 1)
 No repetition – lottery numbers (2, 14, 27, 30, 15, 33)

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 13


Permutations
 With repetition
 If n things to choose from, there are n choices each time!
 While choosing r of them, the permutations are n×n×... (r times)
 n×n×... (r times)=>nr, where n is the number of things to choose from, and
r is the number of chosen things. e.g. 4 digit PIN code of an ATM; n=10 & r=4

 Without repetition
 The number of available choices is reduced, each time
 If n things to choose from , the permutations are n!
 If r things to be chosen out of n things, multiplication must be stop
before (n-r)
 Mathematical notation –
 Example – order of 3 out of 16 pool balls

Permutations = P (16,3) = 3360


Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 14
Combinations
 Without repetition
 The easiest way to understand is to:
 Assume that the order does matter (i.e. permutations),
 Then alter it so the order does not matter.
 Going back to our pool ball example
 3 out of 16 gave us 3360 permutations
 But many of those will be same if the order is not taken care of
 Let’s say balls 1, 2 and 3 were chosen, then the possibilities will be:
 1 2 3, 1 3 2, 2 1 3, 2 3 1, 3 1 2 and 3 2 1 (if the order matters)
 1 2 3 (if the order does not matter)
 Permutations will have 6 times as many possibilities
 How can we find this number (6), directly? Simply by taking factorial (!)
 So, all we need to do is adjust our permutations formula by reducing it
 Thus,
Combinations = Permutations/r!
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 15
Combinations
 Without repetition
 Mathematically

where n is the number of things to choose from, and r is the number of chosen things
 Often called as "n choose r" (such as "16 choose 3")
 Also known as the "Binomial Coefficient“
 Notation

 Symmetricity

Remember!
do the permutation and reduce by r!, or learn by heart
the formula
Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 16
Combinations
 With repetition
 Mathematically

where n is the number of things to choose from, and r is the number of chosen things

Where does it come from?


 Example: selecting three scoops of fruits
 Five fruits: apple, banana, orange, pineapple and grapes, i.e. {a,b,o,p,g}
 Three scoops are to be selected out of five fruits, i.e. r=3, n=5
 Let’s see how it goes ………

 Symmetricity

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 17


Conclusion

Knowing the formulae of permutations and


combinations is only half the battle. Figuring out
how to interpret a real world situation can be
quite hard!
But
At least now you know how to calculate all 4
variations of "Order does/does not matter" and
"Repeats are/are not allowed".

Karachi Institute of Power Engineering 26.02.23 Dr. Adeel Abbas 18

You might also like