Lecture 1 To 4
Lecture 1 To 4
a dataset vary or deviate from a central value, such as the mean or median. It provides
information about the spread or variability within the data.
1. Range
2. Variance
3. Standard Deviation
4. Quartile Deviation (QD)
5. Coefficient of Variation (CV)
6. Mean Absolute Deviation (MAD)
Range is a simple measure of dispersion that quantifies the spread of data by calculating the
difference between the highest and lowest values in a dataset.
For Ungrouped Data, where you have individual data points, the formula for calculating the
range is:
Suppose you have the following dataset of daily temperatures (in °C) for a week in Karachi:
32,34,31,36,29,33,3732,34,31,36,29,33,37
Range = Maximum Value - Minimum Value Range = 37°C (Maximum) - 29°C (Minimum) Range =
8°C
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
For Grouped Data, where data is presented in intervals or classes, finding the exact maximum
and minimum values might not be possible. Instead, you can estimate the range using the
upper limit of the highest interval and the lower limit of the lowest interval. The formula for
grouped data is:
Let's say you have data on the number of employees' ages (in years) in a company, grouped
into age intervals:
Find the Upper Limit of the Highest Interval and the Lower Limit of the Lowest Interval:
Range = Upper Limit of Highest Interval - Lower Limit of Lowest Interval Range = 59 years - 20
years Range = 39 years
Variance is a measure of how individual data points in a dataset differ from the mean (average)
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
of that dataset. It quantifies the spread or dispersion of data points and provides insights into
how much the data values deviate from the central tendency.
Where you have individual data points, the formula for calculating the variance is as follows:
̅̅̅̅2
∑(𝑋−𝑋)
Sample Variance (used for a subset of the population): 𝑆 2 = Ungrouped
𝑛
̅̅̅̅2
∑ 𝑓(𝑋−𝑋)
𝑆2 = Grouped
∑𝑓
∑(𝑋−µ)2
Population Variance (used for the entire population): 𝜎 2 = Ungrouped
𝑁
∑ 𝑓(𝑋−µ)2
𝜎2 = Grouped
∑𝑓
In these formulas:
Ungrouped Data Example: Suppose you have the following dataset of daily temperatures (in
°C) for a week in Karachi: 32,34,31,36,29,33,3732,34,31,36,29,33,37
∑(𝑋 − ̅̅̅
𝑋)2
𝑆2 = = 31.81
𝑛
2. Variance for grouped Data:
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
To calculate the Variance for this grouped data:
∑ 𝑓(𝑋 − ̅̅̅
𝑋)2 5483.22
𝑆2 = = = 101.54
∑𝑓 54
Standard Deviation: The standard deviation is the square root of the variance.
Mean deviation: also known as the mean absolute deviation (MAD), is a measure of the
average absolute differences between data points and the mean (average) of a data set.
̅̅̅| / n (Sample)
Mean Deviation (MAD) = Σ |(𝑋 − 𝑋)
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
Σ represents the sum, which is taken over all data points.
xi represents each individual data point.
μ is the mean (average) of the data set.
N is the total number of population data points.
n is the total number of sample data points.
Suppose we have the following ungrouped data set:
We will calculate the mean deviation from the mean (average) of this data set.
MAD = (|8 - 15| + |12 - 15| + |14 - 15| + |15 - 15| + |16 - 15| + |18 - 15| + |22 - 15|) / 7
MAD = (7 + 3 + 1 + 0 + 1 + 3 + 7) / 7
MAD = 22 / 7
So, the mean deviation for this ungrouped data set is approximately 3.14. This means, on
average, each data point deviates from the mean by about 3.14 units.
C-I Frequency
10 – 19 5
20 – 29 8
30 – 39 12
40 -49 6
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
We will calculate the mean deviation from the mean (average) of this grouped data set. To do
this, we need to find the midpoint of each class interval, and then use the formula for mean
deviation for grouped data: Mean Deviation (MAD) = Σ |xi - μ| * f / N
Where:
Step 2: Calculate the Mean (μ): To calculate the mean, we need to consider the midpoint and
frequency. The formula for the mean is:
μ = Σ (fx) / Σ f
μ ≈ 950.5 / 31
MAD = Σ |xi - μ| * fi / N
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
MAD ≈ 259.25 / 31
So, the mean deviation for this grouped data set is approximately 8.36.
The coefficient of variation (CV) is a measure of relative variability that expresses the standard
deviation (or mean deviation) as a percentage of the mean (average) of a data set.
Where:
Now, let's calculate the coefficient of variation for your data set, for which you previously
calculated the variance (σ² ≈ 104.80) and the mean (μ ≈ 38.89):
So, the coefficient of variation for the data set with a variance of approximately 104.80 and a
mean of approximately 38.89 is approximately 26.34%. This means that the standard deviation
accounts for about 26.34% of the mean, providing a relative measure of the data's variability
compared to its average value.
Probability Definition:
Probability is a way of expressing the likelihood of an event happening. It's a number that
ranges from 0 (impossible) to 1 (certain), or sometimes from 0% to 100%, that helps us
understand how likely something is to occur.
0≤p(A)≤1
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
Role of Probability with Short Examples:
1. Coin Toss (0.5): When you flip a fair coin, there's a 50% probability of getting heads and a 50%
probability of getting tails. It's like a balanced chance.
2. Weather Forecast (0.3): If the weather forecast says there's a 30% chance of rain tomorrow, it
means it's somewhat likely to rain, but it might not. It's like a hint of uncertainty.
3. Dice Roll (1/6): Rolling a standard six-sided die gives each number an equal 1/6 probability of
showing up. So, there's a 1 in 6 chance of getting a specific number.
4. Card Deck (4/52): In a standard deck of 52 cards, drawing an Ace has a 4/52 probability, or
1/13, because there are 4 Aces and 52 total cards.
5. Traffic Light (0.7): When you approach a green traffic light, there's a 70% probability that it will
stay green. But there's still a 30% chance it might turn red. It's about the odds of waiting.
6. Lottery Jackpot (0.0000001): Winning a massive lottery jackpot often has an incredibly low
probability, like 0.00001%. It's like a dream-come-true chance, but very, very rare.
7. Packing for a Trip (0.8): When checking the weather forecast for your trip and it shows an 80%
chance of rain, you'll most likely pack an umbrella. It's about preparing for what's likely.
These examples show how probability is used to understand the chances of different events
occurring, from simple coin flips to complex weather forecasts, and how it influences our
decisions and expectations.
The sample space, denoted as "S," is the set of all possible outcomes of an experiment or random process. It
represents the complete set of things that can happen.
1. Coin Toss:
Sample Space (set notation): S = {Heads, Tails}
Explanation: When you flip a coin, there are two possible outcomes: "Heads" or "Tails."
2. Dice Roll:
Sample Space (set notation): S = {1, 2, 3, 4, 5, 6}
Explanation: Rolling a six-sided die can result in any of the six numbers from 1 to 6.
3. Gender of a Newborn:
Sample Space (set notation): S = {Male, Female}
Explanation: When a child is born, they can be either "Male" or "Female."
4. Weather Forecast (Sunny, Cloudy, Rainy):
Sample Space (set notation): S = {Sunny, Cloudy, Rainy}
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
Explanation: A weather forecast might predict one of these three conditions: "Sunny," "Cloudy," or
"Rainy."
5. Marital Status (Single, Married, Divorced):
Sample Space (set notation): S = {Single, Married, Divorced}
Explanation: When considering the marital status of an individual, they can fall into one of these
three categories.
In these examples, the sample space represents all possible outcomes for the respective events or
experiments. It is essential for understanding and calculating probabilities, as it includes every conceivable
result of the process being analyzed.
Event Definition:
An event in probability is a specific outcome or a set of outcomes that we're interested in. It's a
subset of the sample space, representing the results that match certain criteria or conditions.
Event Examples:
1. Coin Toss:
Event: Getting "Heads" when flipping a coin.
Explanation: In the sample space {Heads, Tails}, the event "Heads" includes the outcome
we're interested in.
2. Dice Roll:
Event: Rolling an even number (2, 4, 6) on a six-sided die.
Explanation: In the sample space {1, 2, 3, 4, 5, 6}, the event "Even Number" consists of
the outcomes we want.
3. Card Draw (from a standard deck):
Event: Drawing a Heart (one of the red suits).
Explanation: In the sample space {Ace of Hearts, 2 of Hearts, ..., King of Hearts, Ace of
Diamonds, 2 of Diamonds, ..., King of Diamonds}, the event "Heart" includes all heart
cards.
4. Gender of a Newborn:
Event: Being "Male."
Explanation: In the sample space {Male, Female}, the event "Male" represents the
desired outcome.
5. Weather Forecast (Sunny, Cloudy, Rainy):
Event: Having a "Sunny" day.
Explanation: In the sample space {Sunny, Cloudy, Rainy}, the event "Sunny" specifies a
particular weather condition.
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
6. Rolling Two Dice:
Event: Getting a sum of 7 when rolling two six-sided dice.
Explanation: In the sample space {(1,1), (1,2), ..., (6,6)}, the event "Sum of 7" identifies
the outcomes that total 7.
7. Marital Status (Single, Married, Divorced):
Event: Being "Married."
Explanation: In the sample space {Single, Married, Divorced}, the event "Married"
describes a specific marital status.
In these examples, an event is defined as a particular outcome or set of outcomes within the
given sample space. It helps us focus on the results that matter for a specific situation or
question.
The complement event of an event A (denoted as A') is the set of all outcomes in the sample
space that are not in event A. In simpler terms, it represents everything that is outside of the
event A.
1. Coin Toss:
Event A: Getting "Heads" when flipping a coin.
Complement Event (A'): Getting "Tails" when flipping a coin.
Explanation: In this example, if event A represents getting "Heads," then its
complement, A', includes all outcomes where "Tails" occurs.
2. Dice Roll:
Event A: Rolling an even number (2, 4, 6) on a six-sided die.
Complement Event (A'): Rolling an odd number (1, 3, 5) on a six-sided die.
Explanation: If event A is about even numbers, its complement event, A', covers all the
possibilities of rolling an odd number.
3. Card Draw (from a standard deck):
Event A: Drawing a Heart (one of the red suits).
Complement Event (A'): Drawing a card from any suit other than hearts.
Explanation: Event A focuses on hearts, while its complement, A', includes all the non-
heart cards in the deck.
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
In these examples, the complement event, A', includes outcomes that are not part of the
original event A. It's a way to capture everything else in the sample space that doesn't meet the
criteria of event A.
The union of two events, A and B, includes all the outcomes that belong to either A, B, or both.
It's like combining the possibilities of both events.
The intersection of two events, A and B, includes only the outcomes that are common to both A
and B. It's like finding the shared results between the two events.
In summary, the union of events (∪) combines all outcomes from each event, while the intersection of events
(∩) considers only the outcomes that are shared by all events. In this example, the union contains {2, 3, 4, 5,
6}, and the intersection contains {4, 6}.
An impossible event is an event that cannot happen under any circumstances. It has a
probability of 0, which means there is no chance of it occurring.
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala
Impossible Event Examples:
A sure event, also known as a certain event, is an event that is guaranteed to happen. Its
probability is 1, which means there is a 100% chance of it occurring.
Adnan Niaz, Lecturer in Statistics, Govt. Graduate College Qila Didar Singh, Gujranwala