Normal Probability Distribution Using R
Experiment
Normal Probability Distribution Using R
1. Aim
To study and implement the Normal probability distribution in R by calculating probabilities, standard scores, generating probability values, and visualizing the normal distribution.
2. Objectives
After completing this experiment, students should be able to:
- Understand the concept and characteristics of the Normal distribution.
- Identify the parameters of a Normal distribution.
- Calculate probabilities using the Normal distribution formula.
- Calculate the standard score (-score).
- Calculate probabilities using R.
- Find probabilities below, above, and between specified values.
- Generate values from a Normal distribution.
- Visualize the Normal distribution using R.
- Interpret the results obtained from a Normal distribution.
3. Theory
3.1 Normal Distribution
The Normal distribution is a continuous probability distribution that is widely used to model naturally occurring measurements such as:
- Heights
- Weights
- Measurement errors
- Examination scores
- Manufacturing measurements
- Blood pressure
- Test scores
The probability density function of a Normal distribution is:
where:
- = population mean
- = population standard deviation
- = observed value
A Normal distribution is completely determined by its mean and standard deviation .
3.2 Characteristics of Normal Distribution
A Normal distribution has the following important characteristics:
- It is continuous.
- It is bell-shaped.
- It is symmetric about the mean.
- Mean, median, and mode are equal.
- The total area under the curve is 1.
- The curve extends theoretically from to .
- The standard deviation determines the spread of the distribution.
4. Problem Statement
The marks obtained by students in a particular examination are approximately normally distributed with:
and
Let represent the examination mark of a randomly selected student.
Therefore:
Using the Normal distribution:
- Calculate the -score for a student who scored 80 marks.
- Find the probability that a randomly selected student scores less than 80.
- Find the probability that a student scores more than 80.
- Find the probability that a student scores between 60 and 80.
- Find the probability that a student scores between 70 and 90.
- Generate a set of random examination marks from the Normal distribution.
- Plot the Normal probability density curve.
- Interpret the results.
5. Manual Calculation
5.1 Calculation of the Z-score
The standard score or -score is calculated using:
For :
Therefore, a score of 80 is one standard deviation above the mean.
5.2 Probability of Scoring Less Than 80
We need to find:
First convert 80 into a -score:
Therefore:
From the standard Normal distribution table:
Therefore:
or approximately 84.13%.
5.3 Probability of Scoring More Than 80
We need:
Using the complement:
Therefore:
or approximately 15.87%.
5.4 Probability of Scoring Between 60 and 80
We need:
Calculate the two -scores.
For :
For :
Therefore:
From the standard Normal distribution:
and
Therefore:
or approximately 68.26%.
This illustrates the well-known 68% rule: approximately 68% of observations in a Normal distribution lie within one standard deviation of the mean.
5.5 Probability of Scoring Between 70 and 90
We need:
For 70:
For 90:
Therefore:
Using the standard Normal distribution:
and
Therefore:
or approximately 47.72%.
6. R Functions for Normal Distribution
R provides the following important functions:
| R Function | Purpose |
|---|---|
dnorm() | Probability density at a specified value |
pnorm() | Cumulative probability |
qnorm() | Quantile corresponding to a probability |
rnorm() | Generates random observations |
For a Normal distribution with mean 70 and standard deviation 10:
dnorm(x, mean = 70, sd = 10)
calculates the density at .
pnorm(x, mean = 70, sd = 10)
calculates:
qnorm(p, mean = 70, sd = 10)
finds the value corresponding to a specified cumulative probability.
rnorm(n, mean = 70, sd = 10)
generates n random observations from the Normal distribution.
7. Program
# Normal Probability Distribution # Parameters mu <- 70 sigma <- 10 # 1. Calculate Z-score for X = 80 x <- 80 z <- (x - mu) / sigma cat("Z-score for X = 80 =", z, "\n") # 2. Probability of scoring less than 80 p_less_80 <- pnorm(80, mean = mu, sd = sigma) cat("P(X < 80) =", p_less_80, "\n") # 3. Probability of scoring more than 80 p_more_80 <- 1 - pnorm(80, mean = mu, sd = sigma) cat("P(X > 80) =", p_more_80, "\n") # 4. Probability of scoring between 60 and 80 p_60_80 <- pnorm(80, mean = mu, sd = sigma) - pnorm(60, mean = mu, sd = sigma) cat("P(60 < X < 80) =", p_60_80, "\n") # 5. Probability of scoring between 70 and 90 p_70_90 <- pnorm(90, mean = mu, sd = sigma) - pnorm(70, mean = mu, sd = sigma) cat("P(70 < X < 90) =", p_70_90, "\n") # 6. Generate random examination marks set.seed(123) marks <- rnorm(100, mean = mu, sd = sigma) cat("\nFirst 10 generated marks:\n") print(marks[1:10]) # 7. Plot the Normal distribution x_values <- seq(30, 110, by = 0.5) y_values <- dnorm(x_values, mean = mu, sd = sigma) plot(x_values, y_values, type = "l", main = "Normal Probability Distribution", xlab = "Examination Marks", ylab = "Probability Density")
8. Expected Result
The program produces approximately the following results:
Z-score for X = 80 = 1 P(X < 80) = 0.8413447 P(X > 80) = 0.1586553 P(60 < X < 80) = 0.6826895 P(70 < X < 90) = 0.4772499
The program also generates 100 random examination marks following:
and displays the Normal distribution as a bell-shaped curve.
9. Interpretation
From the results:
- A score of 80 has a -score of 1, meaning it is one standard deviation above the mean.
- Approximately 84.13% of students are expected to score below 80.
- Approximately 15.87% are expected to score above 80.
- Approximately 68.27% are expected to score between 60 and 80.
- Approximately 47.72% are expected to score between 70 and 90.
The graph should show the characteristic symmetric bell-shaped curve of the Normal distribution, centered at the mean of 70.
Comments
Post a Comment