Ex No 4 A
Ex No 4 A
AIM:
To visualize the probability density function of the normal distribution for IQ scores,
specifically highlighting the area between defined lower and upper bounds, and to
calculate the cumulative probability of a specific IQ value.
ALGORITHM:
1. Define Parameters:
• Set the mean (mean) to 100 and standard deviation (std_dev) to 15, reflecting
typical IQ distribution characteristics.
2. Create IQ Range:
• Specify lower and upper bounds for the shaded area (e.g., 75 and 100).
• Fill the area under the curve between the lower and upper bounds using
plt.fill_between.
• Draw vertical lines to indicate the lower and upper bounds using plt.axvline.
• Add a title, x-label, y-label, and a legend to the plot for clarity.
PROGRAM:
import numpy as np
# Define the parameters for the normal distribution (IQ typically has a mean of 100
and std deviation of 15)
mean = 100
std_dev = 15
# Define the lower and upper bounds for the shaded area
lower_bound = 75
upper_bound = 100
plt.xlabel('IQ')
plt.ylabel('Probability Density')
# Add a legend
plt.legend()
plt.show()
RESULT: