Solved Exercises on Histograms

Master histograms: creating, interpreting, and analyzing quantitative data distributions through these 5 detailed exercises.

Solution: Exercises 1 to 3
1 Test Scores Histogram
Exercise 1
The test scores for 50 students are: 65, 68, 72, 75, 77, 78, 80, 82, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 66, 69, 73, 76, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 67, 70, 74, 77, 80, 82, 84, 86, 88, 90. Create a histogram with appropriate bin width and describe the distribution's shape, center, and spread.
Definition:

Histogram: A graphical representation of quantitative data using bars to show frequency distribution.

Bin Width: The range of values included in each bar (interval size).

Frequency: The number of data points falling within each bin.

Method for creating histograms:
  1. Determine the range of the data (max - min)
  2. Choose an appropriate number of bins (typically 5-15)
  3. Calculate bin width: Range ÷ Number of bins
  4. Define bin boundaries ensuring no gaps or overlaps
  5. Count data points in each bin
  6. Draw bars with heights proportional to frequencies
Score Range Frequency Relative Frequency 65-69 6 0.12 70-74 6 0.12 75-79 6 0.12 80-84 7 0.14 85-89 7 0.14 90-94 7 0.14 95-99 7 0.14 100-104 4 0.08
65-69
70-74
75-79
80-84
85-89
90-94
95-99
100+
Step 1: Analyze the data range

Minimum: 65, Maximum: 100, Range: 100 - 65 = 35

For 50 data points, 8 bins of width 5 seem appropriate

Step 2: Determine bin boundaries

Starting at 65, with bin width of 5: [65-70), [70-75), [75-80), [80-85), [85-90), [90-95), [95-100), [100-105)

Step 3: Count frequencies in each bin

Each bin contains approximately 6-7 data points

Step 4: Analyze the shape

The distribution appears roughly symmetric with a slight right skew due to the last bin.

Most scores cluster in the 80-99 range.

Step 5: Determine center and spread

Median: Approximately 85 (middle value of 50 data points)

Mode: Appears to be in the 80-94 range (highest frequencies)

Spread: Scores range from 65 to 100

Shape
Symmetric
Center
~85
Spread
35
Outliers
None
Symmetric distribution, center ≈ 85, range = 35
Final answer:

The histogram shows a roughly symmetric distribution of test scores.

Center: Around 85, Spread: 65-100

Most students scored between 80 and 99.

Applied rules:

• Bin Width Selection: Balance between detail and clarity (typically 5-15 bins)

• Continuous Data: Histograms for quantitative variables

• Shape Analysis: Symmetric, skewed left/right, uniform

2 Weight Distribution Histogram
Exercise 2
The weights (in pounds) of 40 packages are: 1.2, 1.5, 1.8, 2.1, 2.3, 2.5, 2.7, 2.9, 3.1, 3.3, 3.5, 3.7, 3.9, 4.1, 4.3, 4.5, 4.7, 4.9, 5.1, 5.3, 5.5, 5.7, 5.9, 6.1, 6.3, 6.5, 6.7, 6.9, 7.1, 7.3, 7.5, 7.7, 7.9, 8.1, 8.3, 8.5, 8.7, 8.9, 9.1, 9.3. Create a histogram and determine if the distribution is skewed. Find the median and describe the spread.
Definition:

Continuous Data: Data that can take any value within a range.

Skewed Distribution: Asymmetric with a longer tail on one side.

Right Skewed: Tail extends to the right (higher values).

Weight Range (lbs) Frequency Relative Frequency 1.0-2.0 3 0.075 2.0-3.0 3 0.075 3.0-4.0 4 0.100 4.0-5.0 4 0.100 5.0-6.0 4 0.100 6.0-7.0 4 0.100 7.0-8.0 4 0.100 8.0-9.0 4 0.100 9.0-10.0 4 0.100 10.0-11.0 6 0.150
1.0-2.0
2.0-3.0
3.0-4.0
4.0-5.0
5.0-6.0
6.0-7.0
7.0-8.0
8.0-9.0
9.0-10.0
10.0-11.0
Step 1: Identify data characteristics

Range: 1.2 to 9.3, Total data points: 40

Using 10 bins of width 1.0 pound

Step 2: Analyze the shape

The distribution appears slightly right-skewed.

Lower weight bins have fewer packages, while higher weight bins have more.

The last bin (10.0-11.0) has the highest frequency.

Step 3: Calculate median

With 40 values, median is average of 20th and 21st values when ordered.

Looking at the ordered data: median ≈ (5.1 + 5.3) ÷ 2 = 5.2 pounds

Step 4: Assess spread

Range: 9.3 - 1.2 = 8.1 pounds

Most packages weigh between 3.0 and 10.0 pounds

Step 5: Identify patterns

More packages in higher weight categories, suggesting a right-skewed distribution.

Lightest packages: 1.2-2.0 lbs (3 packages)

Heaviest packages: 9.0-10.0 lbs (4 packages) and 10.0-11.0 lbs (6 packages)

Shape
Right Skewed
Median
5.2 lbs
Range
8.1 lbs
Mode
10.0-11.0 lbs
Right-skewed distribution, median = 5.2 lbs, range = 8.1 lbs
Final answer:

The weight distribution is right-skewed with a median of 5.2 pounds.

Range: 8.1 pounds, Mode: 10.0-11.0 pound range

More packages are in the higher weight categories.

Applied rules:

• Skewness Detection: Longer tail indicates direction of skew

• Median Calculation: Middle value(s) when data is ordered

• Range: Maximum - Minimum

3 Commute Time Analysis
Exercise 3
The commute times (in minutes) for 60 workers are: 15, 18, 22, 25, 28, 30, 32, 35, 38, 40, 42, 45, 48, 50, 52, 55, 58, 60, 62, 65, 68, 70, 72, 75, 78, 80, 82, 85, 88, 90, 16, 19, 23, 26, 29, 31, 33, 36, 39, 41, 43, 46, 49, 51, 53, 56, 59, 61, 63, 66, 17, 20, 24, 27, 30, 32, 34, 37, 39, 41. Create a histogram with 7 bins and analyze the distribution's shape, center, and spread.
Definition:

Bin Count: The number of intervals used to group the data.

Frequency Density: Frequency divided by bin width (for unequal bins).

Commute Time (min) Frequency Relative Frequency 15-25 10 0.167 25-35 12 0.200 35-45 10 0.167 45-55 8 0.133 55-65 8 0.133 65-75 6 0.100 75-85 4 0.067 85-95 2 0.033
15-25
25-35
35-45
45-55
55-65
65-75
75-85
85-95
Step 1: Determine bin parameters

Range: 90 - 15 = 75 minutes

With 7 bins: Bin width ≈ 75 ÷ 7 ≈ 10.7, rounded to 10 for simplicity

Step 2: Analyze the shape

The distribution appears left-skewed (negatively skewed).

Most commuters have shorter commute times (15-35 minutes).

Fewer people have longer commutes, with a tail extending to the right.

Step 3: Identify the center

With 60 values, median is average of 30th and 31st values.

Median ≈ 35-40 minutes (in the 35-45 bin)

Step 4: Assess spread

Range: 90 - 15 = 75 minutes

IQR: Interquartile range would span the middle 50% of data

Step 5: Describe the pattern

Majority of workers have commutes of 15-35 minutes

Commute times decrease as duration increases

Long commutes (75+ minutes) are rare

Shape
Left Skewed
Center
35-40 min
Spread
75 min
Mode
25-35 min
Left-skewed distribution, center ≈ 35-40 min, range = 75 min
Final answer:

The commute time distribution is left-skewed.

Center: Approximately 35-40 minutes, Range: 75 minutes

Most workers have shorter commutes with fewer having long commutes.

Applied rules:

• Skewness Direction: Tail direction determines skew name

• Bin Width Selection: Balance detail with clarity

• Mode Identification: Highest frequency bin

Histograms: Core Concepts
\text{Bin Width} = \frac{\text{Range}}{\text{Number of Bins}}
Bin Width Formula
Frequency
Count
Number of values
Relative Freq.
Proportion
Frequency ÷ Total
Density
Freq ÷ Width
For unequal bins
Key definitions:

Histogram: A graphical display of quantitative data using adjacent bars to show the distribution of values.

Bin: An interval of values that groups the data.

Frequency: The number of data points in each bin.

Relative Frequency: The proportion of data points in each bin.

Best For: Quantitative (numerical) continuous or discrete data with many possible values.
Advantages: Shows shape, center, and spread; identifies patterns and outliers; handles large datasets well.
Tip 1: Choose bin width carefully - too wide loses detail, too narrow creates noise.
Tip 2: Use 5-15 bins for most datasets to balance detail and clarity.
Tip 3: Look for symmetry, skewness, modality (peaks), and outliers in the shape.
Essential formulas:

• Bin Width = (Max - Min) ÷ Number of Bins

• Relative Frequency = Frequency ÷ Total Count

• Density = Frequency ÷ Bin Width (for unequal bins)

• Center: Use median or mean depending on distribution shape

Solution: Exercises 4 to 5
4 Gas Mileage Histogram
Exercise 4
The gas mileage (miles per gallon) for 80 cars is grouped as follows: 10-15 mpg (5 cars), 15-20 mpg (12 cars), 20-25 mpg (20 cars), 25-30 mpg (25 cars), 30-35 mpg (15 cars), 35-40 mpg (3 cars). Create a histogram and determine if the distribution is approximately normal. Find the mode and estimate the median.
Definition:

Normal Distribution: Bell-shaped, symmetric distribution with specific properties.

Mode: The value with the highest frequency.

Mileage Range (mpg) Frequency Relative Frequency 10-15 5 0.0625 15-20 12 0.1500 20-25 20 0.2500 25-30 25 0.3125 30-35 15 0.1875 35-40 3 0.0375
10-15
15-20
20-25
25-30
30-35
35-40
Step 1: Analyze the shape

The distribution is unimodal with the peak in the 25-30 mpg range.

It appears slightly right-skewed as the tail extends to the right.

Step 2: Determine if it's approximately normal

No, this distribution is not normal:

• It's right-skewed, not symmetric

• Normal distributions have specific proportions in each standard deviation range

Step 3: Identify the mode

The mode is in the 25-30 mpg range with 25 cars.

Step 4: Estimate the median

With 80 values, median is between 40th and 41st values.

Cumulative frequencies: 5, 17, 37, 62, 77, 80

40th and 41st values fall in the 25-30 mpg range.

Estimated median: 25-30 mpg (approximately 27.5 mpg)

Step 5: Assess the spread

Range: 40 - 10 = 30 mpg

Most cars (75%) have mileage between 15-35 mpg

Shape
Right Skewed
Mode
25-30 mpg
Median
~27.5 mpg
Normal?
No
Right-skewed, mode = 25-30 mpg, median ≈ 27.5 mpg, not normal
Final answer:

The distribution is right-skewed, not approximately normal.

Mode: 25-30 mpg (25 cars), Estimated median: ~27.5 mpg

Most cars have gas mileage between 15-35 mpg.

Applied rules:

• Normal Distribution: Symmetric, bell-shaped with specific proportions

• Skewness Detection: Longer tail indicates direction

• Median Estimation: Find middle value using cumulative frequencies

5 Salary Distribution Analysis
Exercise 5
Annual salaries (in thousands) for 100 employees are: 30-40k (8), 40-50k (15), 50-60k (22), 60-70k (25), 70-80k (18), 80-90k (10), 90-100k (2). Create a histogram and describe the distribution's shape, center, and spread. Calculate the mean salary if the midpoint of each bin is used.
Definition:

Midpoint: The center value of each bin, used for approximation.

Weighted Average: Mean calculated using frequencies as weights.

Salary Range (k$) Frequency Midpoint Midpoint × Freq 30-40 8 35 280 40-50 15 45 675 50-60 22 55 1210 60-70 25 65 1625 70-80 18 75 1350 80-90 10 85 850 90-100 2 95 190
30-40k
40-50k
50-60k
60-70k
70-80k
80-90k
90-100k
Step 1: Analyze the shape

The distribution is unimodal with the peak in the 60-70k range.

It appears slightly right-skewed as the tail extends to higher salaries.

Step 2: Identify the mode

The mode is in the 60-70k range with 25 employees.

Step 3: Estimate the median

With 100 employees, median is between 50th and 51st values.

Cumulative frequencies: 8, 23, 45, 70, 88, 98, 100

50th and 51st values fall in the 60-70k range.

Median: 60-70k (approximately 65k)

Step 4: Calculate the mean using midpoints

Mean = Σ(Midpoint × Frequency) ÷ Total

= (280 + 675 + 1210 + 1625 + 1350 + 850 + 190) ÷ 100

= 6180 ÷ 100 = 61.8 thousand dollars

Step 5: Assess the spread

Range: 100k - 30k = 70k

Most employees (90%) earn between 40k-90k

Shape
Right Skewed
Mode
60-70k
Median
~65k
Mean
61.8k
Right-skewed, mode = 60-70k, median ≈ 65k, mean = 61.8k
Final answer:

The salary distribution is right-skewed with a mode of 60-70k.

Median: ~65k, Mean: 61.8k

Most employees earn between 40k-90k annually.

Applied rules:

• Weighted Mean: Mean = Σ(midpoint × frequency) ÷ total

• Median Estimation: Find middle value using cumulative frequencies

• Skewness Impact: Mean > Median in right-skewed distribution

Histograms: Comprehensive Summary

Complete Summary: Analyzing Association in Two-Way Tables

Core Concepts

Two-Way Table: Displays the frequency distribution of two categorical variables.

Marginal Frequency: Totals for each row and column.

Joint Frequency: Frequency in each individual cell.

Conditional Frequency: Frequency of one variable given a specific value of another.

Key Properties

Association Detection: Compare conditional relative frequencies across categories.

Independence: Conditional frequencies are similar across categories.

Dependence: Conditional frequencies differ significantly across categories.

Chi-Square Test: Statistical test for independence (advanced).

Analysis Process

Step 1: Construct the two-way table with observed frequencies.

Step 2: Calculate marginal totals.

Step 3: Compute conditional relative frequencies for each category.

Step 4: Compare conditional frequencies to assess association.

Step 5: Draw conclusions about the relationship.

Association Strength

Strong Association: Large differences in conditional frequencies.

Moderate Association: Noticeable but not dramatic differences.

Weak Association: Small differences in conditional frequencies.

Independence: Similar conditional frequencies across categories.

Detailed Definitions:

Association: A relationship between two variables where knowing the value of one variable provides information about the value of the other.

Conditional Relative Frequency: The relative frequency of one variable given a specific value of another variable.

Independence: No relationship exists between variables; the conditional relative frequencies are the same across all categories.

Contingency Table: Another name for a two-way table.

Marginal Distribution: The distribution of one variable ignoring the other.

Systematic Analysis Method:
  1. Construct Table: Organize data into a two-way table format.
  2. Calculate Marginals: Find row and column totals.
  3. Compute Conditional Frequencies: Calculate P(A|B) for each category of B.
  4. Compare Frequencies: Look for differences in conditional relative frequencies.
  5. Determine Association: Decide if variables are associated or independent.
Memory Tip: "Condition on the row variable when comparing across columns."
Common Mistake: Using wrong denominator when calculating conditional frequencies.
Efficiency Tip: Convert to percentages for easier comparison of conditional frequencies.
Analysis Tip: Look for systematic patterns in the differences across categories.
Key Applications: Survey analysis, medical studies, market research, educational assessments.
Important Note: Association does not imply causation; correlation doesn't prove cause-and-effect.
Critical formulas to remember:

• Conditional Relative Frequency = Cell Value ÷ Row/Column Total

• Marginal Relative Frequency = Row/Column Total ÷ Grand Total

• Association exists when conditional frequencies differ significantly

• Independence exists when conditional frequencies are similar

Questions & Answers

Question: How do I know if the differences in conditional relative frequencies are significant enough to claim association?

Answer: At the high school level, use these guidelines:

Practical Significance:

  • Differences > 15-20% suggest strong association
  • Differences 5-15% suggest moderate association
  • Differences < 5% suggest weak or no association

Context Matters:

What matters depends on the situation. A 5% difference in drug effectiveness could be clinically significant, while a 20% difference in survey responses might not be practically meaningful.

Advanced Statistics:

Later, you'll learn the chi-square test of independence, which provides a statistical measure of significance based on sample size and observed differences.

Question: Can two variables be associated but not causally related? What's the difference?

Answer: Yes, association does not imply causation!

Association vs. Causation:

  • Association: Variables tend to occur together (correlation)
  • Causation: One variable directly causes changes in another

Examples of Association Without Causation:

  • Ice cream sales and drowning incidents (both increase in summer)
  • Shoe size and reading ability in children (both related to age)
  • Number of firefighters and fire damage (more severe fires require more firefighters)

Association indicates a relationship that may warrant further investigation, but establishing causation requires controlled experiments and ruling out confounding variables.

Question: When calculating conditional relative frequencies, should I condition on rows or columns?

Answer: The choice depends on what question you're trying to answer:

Condition on Rows: When you want to know the distribution of the column variable given each row category.

Example: P(Like Product | Gender) - probability of liking the product given the person's gender.

Condition on Columns: When you want to know the distribution of the row variable given each column category.

Example: P(Gender | Like Product) - probability of being a certain gender given that the person likes the product.

Both approaches are valid and can reveal different insights. The key is to be consistent in your analysis and clearly state what you're conditioning on.