Challenge

Basics of Probability and Statistics Week 1 Challenge

Q1.

The difference in the formula of variance between population and sample lies in how we account for the amount of data we have. Specifically, it depends whether we are working with a complete dataset (the entire population) or a subset of that dataset (a sample).

Population Variance:

  • When we have the entire population, we calculate the variance by averaging the squared differences between each data point and the mean of the population. The formula is:

σ2=1N∑i=1N(xi−μ)2

where:

  • N is the total number of data points in the population,
  • xi is each individual data point,
  • μ is the population mean.

Sample Variance:

  • When we have only a sample, we use the sample mean as an estimate of the population mean, but this introduces a degree of error. To correct for this and avoid underestimating the variance, we divide by n−1(where n is the sample size) instead of n. The formula is:

s2=1n−1∑i=1n(xi−xˉ)2

where:

  • n is the sample size,
  • xi is each individual data point,
  • xˉ is the sample mean.

Dividing by n−1 instead of n is called Bessel's correction and compensates for the fact that using the sample mean underestimates the true variance of the population.

Example

Imagine you're trying to measure the average depth of holes in a garden. If you measure every hole (the population), you get a true representation of the garden's average depth. But if you measure only a few holes (a sample), you might miss some outliers. To account for this, you adjust your estimate a bit, pretending the garden might have deeper or shallower holes you didn’t measure, and this adjustment is the n−1 factor.



Q2.

Stratified Sampling and Clustered Sampling are both probability sampling techniques used in statistical analysis, but they differ in how they select the groups (strata or clusters) and how data is drawn from them.

1. Stratified Sampling

  • In stratified sampling, the population is divided into distinct strata (subgroups) based on a shared characteristic (e.g., age, income level, geographic location). Then, a sample is drawn randomly from each stratum. This method ensures that each subgroup is proportionally represented in the sample.
  • This method reduces variability within each subgroup, which often leads to higher precision in the estimate of the population parameter.
Mathematical Formula for Stratified Sampling

The overall estimate from stratified sampling is often calculated by weighted averaging the estimates from each stratum:

μ^stratified=∑i=1L(NiN)μ^i​

where:

  • L is the number of strata,
  • Ni​ is the size of stratum i,
  • N is the total population size,
  • μ^i is the sample mean from stratum i,
  • NiN is the proportion of the population in stratum i.

The variance of the stratified sample is:

Var(μ^stratified)=∑i=1L(NiN)2Varin​​

where Vari is the variance in stratum i and ni is the sample size from stratum i.

2. Clustered Sampling

  • In clustered sampling, the population is divided into clusters (often naturally occurring groups such as neighborhoods, schools, or cities), and then entire clusters are randomly selected. Unlike stratified sampling, all individuals from the chosen clusters are included in the sample, or a random sample is taken from within the selected clusters.
  • This technique is often used when it's impractical to survey an entire population, but it's easier to survey whole groups.
  • However, there can be higher variability between clusters, and the precision of the estimates might be lower compared to stratified sampling.
Mathematical Formula for Clustered Sampling

If we select M clusters, each containing ni units, the estimate of the population mean is:

μ^clustered=1M∑i=1Mμ^​

where:

  • Mis the number of clusters selected,
  • μ^i is the sample mean from cluster i.

The variance of the clustered sample mean depends on within-cluster variance and between-cluster variance:

Var(μ^clustered)=1M[∑i=1M(niVari)M(n−1)]

where Variis the variance within each cluster.

Example

Imagine you’re trying to understand the average height of trees in a forest:

  • Stratified sampling is like dividing the forest into different tree types (oak, pine), then measuring the height of a sample of trees from each type. This ensures you account for the differences in tree species.
  • Clustered sampling is like dividing the forest into different regions (clusters) and measuring the height of all trees in just a few randomly chosen regions. Each region represents the forest as a whole, but you might miss some diversity.



Q3

Let us consider a case where the size of population is 4

X={A,B,C,D}X={A,B,C,D}

The different samples possible are : {A}, {B}, {C}, {D}, {A,B}, {A,C}, {A,D}, {B,C}, {B,D},{C,D},{A,B,C},{A,B,D},{A,C,D},{B,C,D},{A,B,C,D}

The total number of samples = 15 = 24−124-1

Therefore, the total number of samples that can be generated from a population of size N = 2N−1



Q4

  • Total number of cards: 52 cards in total.
  • Number of jacks in the deck: There are 4 jacks in the deck (one for each suit: hearts, diamonds, clubs, spades).
  • First draw:
    The probability of drawing a jack on the first draw is:

    P(J1)=4/52=1/13


    Second draw (without replacement):

    Now, there are 51 cards left in the deck and only 3 jacks remaining.

    The probability of drawing a second jack is:

    P(J2)=3/51

    Total probability:

    • Since both events must happen (drawing two jacks), multiply the probabilities of the two events:

    P(2jacks)=(4/52)(3/51)=12/2652=1/221

    Therefore, the probability of drawing 2 jacks from a deck of 52 cards without replacement is:

    1/22​1



    Q5

    Total outcomes:

    • Each die has 6 faces, so the total number of possible outcomes when rolling two dice is:

    6*6=36

    Favorable outcomes (doubles):

    To have both dice show the same number, the possible pairs are:

    (1,1),(2,2),(3,3),(4,4),(5,5),(6,6)

    There are 6 favorable outcomes (one for each number).

    Probability of doubles:

    The probability is the number of favorable outcomes divided by the total number of outcomes:

    P(doubles)=6/36=1/6

    Therefore, the probability of rolling the same number on both dice is:

    1/6



    Q6
    1. Definition of Variance:

    The variance σ2\sigma^2of a dataset is the average squared deviation of each data point from the mean. It is calculated as:

    σ2=1n∑i=1n(xi−μ)2

    where:

    • xix_i is each data point,
    • μ\mu is the mean of the data,
    • nn is the number of data points.

    2. Definition of Standard Deviation:

    The standard deviation σ\sigma is simply the square root of the variance:

    σ=σ2=1n∑i=1n(xi−μ)2​

    Thus, it measures the same thing, but in the original units of the data.

    Reason for Standard Deviation:

    • Units consistency:
      • The variance σ2\sigma^2 measures the spread in squared units (e.g., if the data is in meters, the variance is in square meters). This makes comparisons and interpretations less intuitive.
      • The standard deviation σ\sigma, being the square root of variance, restores the units back to the original scale (e.g., meters), making it easier to interpret how much data deviates from the mean in real-world terms.

    Example:

    Suppose you are measuring the heights of individuals in centimeters:

    • Variance might be 400 cm2400 \, \text{cm}^2, which is not easy to interpret since we don’t think about dispersion in square centimeters.
    • Standard deviation would be 400=20 cm, which means the typical deviation from the mean height is about 20 cm. This is far more intuitive.
    Note:-

    While variance is useful mathematically (especially in theoretical contexts), standard deviation provides more practical insights into the spread of the data in original units. For example, in many statistical models and empirical data analysis, interpreting variation in standard deviation is more intuitive.

    Thus, standard deviation is preferred because it converts the squared deviations back to the original scale, making the measure of dispersion easier to understand and use.

    Your portfolio, next

    Ship work like this
    in your own course.

    Talk to a career counsellor

    Free 20-minute call. We'll map the right course to where you want to work.

    By submitting you agree to our Terms and Privacy Policy.