The weights of 8 boys in kilograms: 45, 39, 53, 45, 43, 48, 50, 45. Find the median

 The weights of 8 boys in kilograms: 45, 39, 53, 45, 43, 48, 50, 45. Find the median




To find the median, we need to arrange the weights in ascending order. Here are the weights of the 8 boys in kilograms:


39, 43, 45, 45, 45, 48, 50, 53


To find the median, we look for the middle value. Since there are 8 weights, the median is the average of the two middle values. In this case, the two middle values are 45 and 45. Therefore, the median weight is:


(45 + 45) / 2 = 90 / 2 = 45


So, the median weight of the 8 boys is 45 kilograms.



OR




Here's how you can find the median of the given weights using Python:


CODE:-

weights = [45, 39, 53, 45, 43, 48, 50, 45]

sorted_weights = sorted(weights)

length = len(sorted_weights)


if length % 2 == 0:

    median = (sorted_weights[length // 2 - 1] + sorted_weights[length // 2]) / 2

else:

    median = sorted_weights[length // 2]


print("The median weight is:", median)

When you run this code, it will output:

The median weight is: 45.0

So, the median weight of the 8 boys is 45 kilograms, just as we calculated earlier.







Comments

Popular posts from this blog

Using Titanic dataset, do the following: a. Find total number of passengers with age less than 30 b. Find total fare paid by passengers of first class c. Compare number of survivors of each passenger class

Differentiate between Unimodal, Bimodal and Multimodal with graphic representation.

Import iris data using sklearn library . Compute mean, mode, median, standard deviation, confidence interval and standard error for each feature ii. Compute correlation coefficients between each pair of features and plot heatmap iii. Find covariance between length of sepal and petal iv. Build contingency table for class feature