Averages

Manvi Chaddha
Last Updated: May 13, 2022

Introduction

Finding averages of a set of numbers is something we all have done in mathematics during school days, and we have to do it in college.

The reason is questions related to averages are asked in the Aptitude round of Companies. The aptitude test eliminates the students who score less than cut-off marks, so it is essential to ace the Aptitude test.  


If you are looking for Aptitude preparation, you must check out the Aptitude Preparation Guided Path on CodeStudio, where all the necessary domains in aptitude are covered in-depth.

This blog will discuss Averages in detail.

What are Averages?

In simple terms, an average can be defined as a number that measures the central tendency of a set of numbers. In other words, it is an estimate where the center point of the set of numbers lies. Average is also known as the mean.

The average is that single number that can replace each given number present in the set with the average number and still get the same total.

For example, consider that you are trying to find the average height of a group of 4 persons. The heights are 140cm, 142cm, 144cm, 146cm. The average height can be calculated as shown below:

Average height = (140 + 142 + 144 + 146)/4 = 572/4 = 143cm.

How to find an Average from a set of numbers?

The above example of finding the average height was quite simple, and there 0.0001% chance that such types of questions will be asked in interviews and competitive examinations. Before moving on to the questions, it is essential to understand how to find an average of a set of numbers.

Using Formula

An average of a group of numbers can be very easily found by using the standard formula.

Average = Sum of the numbers / Total number of numbers

Let's again consider an example of petrol prices over five consecutive Months and let's find the average price of petrol using the standard formula.

Prices of petrol are as follows, 90 for Month1, 88 for Month 2, 99 for Month 3 and 102 for Month 4 and 95 for Month 5 respectively.

Average = (90 + 88 + 99 + 102 + 95) / 5

The average price of petrol is 94.8 Rupees over 5 months.

Using Assumed Average Approach

The standard approach of finding the average is quite straightforward, and you may use it when finding an average from a set of few numbers and when the numbers are small. However, as the count of numbers increases, summing up the numbers is not an efficient approach, especially when solving questions in an examination where every minute matters.

Another approach is the assumed average approach, wherein you will assume an average value from the set of numbers. The following are the steps to find average using the assumed average approach:

Step1. You have to assume an average. 

Step2. Calculate how much the given numbers deviate from the assumed average. 

Step3. Calculate the sum of all the deviations (i.e., Total deviation). 

Step4. Calculate the average deviation with the help of the following formula : 


Average Deviation = Total Deviation / The number of numbers.

Step5. Now, the correct average will be equal to the sum of the assumed average and average deviation. i.e. Correct average = Assumed average + Average Deviation.

Let's try to solve the above problem of finding the average price of petrol over 5 months using this approach. 

Step 1: Consider the assumed mean to be 96.

Step 2: Calculate the deviation

Petrol PriceAssumed AverageDeviation
9096-6
8896-8
99963
102966
9596-1

 

 

Step 3: The net sum of these deviations is (-6 + (-8) + 3 + 6 + (-1)) = -1

Step 4: Average Deviation = -6/5 = -1.2

Step 5: Correct Average: 96 + (-1.2) = 94.8

The average is 94.8, which is the same value obtained by using the standard formula. Note that even though you may take any value as an assumed average value, it is recommended to take the assumed average to be nearly equal to one of the given values for simple calculations.

Important Points

The rules mentioned below are quite handy when solving questions and sometimes questions are asked directly related to these rules. 

  1. Average of the first n natural numbers = (n + 1) /2
  2. Average of the square of first n natural numbers = (n + 1)(2n + 1)/6
  3. Average of cube of first n natural numbers = n(n + 1)^2/4
  4. Average of first n natural odd numbers = n.
  5. Average of first n natural even numbers = n + 1

 

Lets assume n = 10.

So average of first 10 natural numbers = (10 + 1)/2 = 5.5

Average of the square of first 10 natural numbers = (10 + 1)(2*`10 + 1)/6 = 38.5

Average of cube of first 10 natural numbers = 10(10 + 1)^2/4 = 10 * 121/4 = 52.5

Average of first 10 natural odd numbers =  10

Average of first 10 natural even numbers = 11

You may try finding these averages on your own using the standard formula and the assumed average approach to level up your average finding skills. The answer will be the same.

Understanding Questions Related to Averages

So far, we have seen how to find averages using two approaches and also did some basic questions. However, the questions asked in reality are quite different. This section will introduce you to some of the standard situations of the questions and will show you how to solve them.

So consider that you are given that, “The average price of a set of 10 T-Shirts of X brand is 400."

That means the total cost of 10 T-Shirts of brand X is 10 * 400 = 4000.

The same question can be twisted as, "The average price of a set of n T-Shirts of X brand is 400. The total cost of n T-shirts is 4000; find the number of T-Shirts."

Using the standard formula for finding the average

The average price of a T-Shirt = Total cost of T-Shirts / Total number of numbers

400 = 4000/n => n = 10

Situation 1

One of the common types of questions asked revolves around the situation; You will be given an average of n numbers, a new number is added to the group, the new average after the addition of a number will be given. You need to find the new number.

An example based on the given situation is, consider that the average marks of a student in 5 subjects are 86. The student forgot to add the marks of one subject; after adding the marks of the 6th subject, the new average is 88. Find the marks in the sixth subject.

Solution: Average marks in 5 subjects = 86

Total marks in 5 subjects = Average marks in 5 subjects * Count of subject =  86 * 5  = 430

 Average marks in 6 subjects = 88

Total marks in 6 subjects = Average marks in 6 subjects * Count of subjects= 88 * 6  = 528

 Marks in sixth subject = Total marks in 6 subjects - Total marks in 5 subject = 528 - 430 = 98

Another variation is, you will be given an average of n numbers, a number is removed from the group, and the new average after removing the number is also given. Find the number removed from the group.

An example based on the above situation is, consider that you are given average marks of 5 subjects to be 96. The student now calculates the average of 4 subjects; the new average is 98. Find the marks of the subject which he does not take into account while calculating the average of 4 subjects.

Solution:   Average marks in 5 subjects =  96

 Total marks in 5 subjects = Average marks in 5 subjects * Count of subjects=  96 * 5= 480

  Average marks in 4 subjects = 98

 Total marks in 4 subjects = Average marks in 4 subjects * Count of subjects = 98 * 4 = 392

  Marks in subject = Total marks in 5 subjects - Total marks in 4 subjects= 480 - 392 = 88

Hence the mark of the subject, which he does not take into account while calculating the average of 4 subjects, is 88.

Situation 2

The second type of question asked revolves around the situation, and You will be given an average of n numbers, more than one number is added to the group, the new average after the addition of a number will be given. You need to find the average of the new numbers added.

An example based on the given situation is, consider that the average marks of a student in 5 subjects are 86. The student forgot to add the marks of two subjects, after adding the marks of the two subjects, the new average is 85. Find the average marks in those two subjects.

Solution: Total of two numbers = (Sum of 7 numbers) - (Sum of 5 numbers) = (Average of 7 numbers * 7) - (Average of 5 numbers * 5) = (85 * 7) - (86 * 5) = 595 - 430 = 165

Average of two numbers = 165/2 = 82.5

Similarly, a possible variation is an average of n numbers will be given, m numbers are removed where m < n, and the new average will be given. You need to find the average of numbers removed.

An example based on the given situation is, consider that the average marks of a student in 5 subjects are 86. The student now removes the marks of 2 subjects, and the new average is 92. Find the average marks in those two subjects.

Solution: Sum of marks in two subjects = (Sum of marks in 5 subjects) - (Sum of marks in 3 subjects = (5 * 86) - (92 * 3)  = 430 - 276  = 154

Average marks in those two subjects = 154/2 = 77.

Example: After 120 innings batsman has an average of 55. And he realizes that he is going to play 180 innings more, and he wants an average of 100 runs per inning. So what should be the average of the remaining 180 innings?

Explanation: The question is in line with Situation 2 discussed above. 

Solution:

The score of 180 innings = (Score of 300 innings) - (Score of 120 innings)

The score of 180 innings = (Average of 300 innings * 300) - (Average of 120 innings * 120)

The score of 180 innings = 100 * 300 - (55 * 120)

The score of 180 innings = 30000 - 6600

The score of 180 innings = 23400

Average score of 80 innings = 23400/180 = 130

Situation 3

The third type of question asked revolves around the situation, and You will be given an average of n numbers, a number is replaced in the group, the new average after the replacement of the number will be given. You need to find the number replaced.

Note that since a number is replaced, it means at first a number will be deleted, and in its place, a new number will be added. That is a combination of Situations 1 and 2 discussed above.

An example based on the above situation is, A set of 5 numbers with an average of 13, and one number is replaced. The average is increased by 4. The outgoing number is 32, then find the replaced number?

Solution: In such types of questions, it is important to note that after the replacement, if the average increases, then the number added will be greater than the number removed and vice versa. No hard facts; you may figure it out on your own by trying few questions and observing the pattern.

Original Sum of 5 numbers without any replacement  = ( 5 * 13 ) = 65

A number is replaced by another number, the number removed is 32 and the number inserted is, let's say, x.

Sum of 5 numbers after the replacement = ( 5 * 17) = 85.

(Note that we have taken an average of 17 as given in the question, the average increases by 4).

We are also given that the outgoing number is 32. Let us assume the incoming number to be x. So clearly, the original sum of 5 numbers without any replacement minus the outgoing number will be equal to the sum of four numbers.

Sum of four numbers = 65 - 32 = 33.

In the sum of five numbers after the replacement, four numbers will be the same as taken in the original average, and the fifth number will be the incoming number.

Sum of five numbers after the replacement =  Sum of four numbers + Incoming Number

85 = 33 + x

x = 85 - 33 = 52

Hence the incoming number is 52.

Let’s take another example wherein the average will decrease after the replacement of a number, A set of 5 numbers with an average of 13, and one number is replaced. The average is decreased by 4. The outgoing number is 32, then find the replaced number?

Solution: Sum of original numbers = 5 * 13 = 65

Sum of numbers after the replacement = 5 * 9 = 45. Note that it is given that the average decreases by 4.

Outgoing number = 32.

Incoming number = x

In the sum of five numbers after the replacement, four numbers will be the same as taken in the original average, and the fifth number will be the incoming number.

Sum of four numbers = Sum of five numbers before replacement - Outgoing number

  = 65 - 32

  = 33

Sum of five numbers after replacement = Sum of four numbers + Incoming Number

45 = 33 + x

x = 12

Hence the replaced number is 12.

Concept of Weighted Average

The weighted average is a calculation that takes into account the varying degrees of importance of the numbers in a data set. In calculating a weighted average, each number in the data set is multiplied by a predetermined weight before the final calculation is made.

It’s used in cases where the relative importance or frequency of some factors need to be taken care of. For example, a survey may gather enough responses from every age group to be considered statistically valid, but the 18-34 age group may have fewer respondents than all others relative to their share of the population. The survey team may weigh the results of the 18-34 age group so that their views are represented proportionately.

The formula for weighted Average, considering that there are k groups with averages A1, A2, ….. Ak and having n1, n2, …… nk elements, then the weighted average is:

Aw = n1A1 + n2A2 + n3A3 + ……………….. nkAk / n1 + n2 + n3 + ……… nk.

Let us consider an example of a weighted average. Suppose you purchase 30Rs/kg rice and 70Rs/kg rice in the ratio 2:3. What is the average price of rice?

Solution: Average price = (n1A1 +n2A2)/(n1+n2)

Here, A1= 30 , A2 = 70 , n1 = 2 , n2 = 3

Average price = (2× 30+3×70)/(2 + 3)

= 270/5 = 54Rs/kg

Another possible example is, Let say you invest 2 lac and give a 30% return. Investment of 3 lac rupees, give70% return. What is the average % return? 

Solution : Average % return = (n1A1 +n2A2)/(n1+n2) 

Here, A1= 30% , A2 = 70% , n1 = 2 Lac , n2 = 3 Lac 

Average % return = (2× 30+3×70)/(2 + 3) = 270/5 = 54 %.

Frequently Asked Questions

Q1) How to find the average of n numbers?

Ans 1) The average of n numbers can be calculated using the formula.

Average = Sum of n numbers / n

Another approach is the assumed average approach 

Q2) What is the weighted average?

Ans 2) The weighted average is a calculation that takes into account the varying degrees of importance of the numbers in a data set. In calculating a weighted average, each number in the data set is multiplied by a predetermined weight before the final calculation is made.

Q3) What is the average of first n natural numbers?

Ans 3) Average of the first n natural numbers = (n + 1) /2

Key Takeaways

This blog discussed how to find Averages in detail. With this done, you may now switch towards aptitude preparation from our Guided Path.

A common problem faced by all of us is we prepare well, but during online assessments, we are unable to solve the questions on time. To overcome this, Coding Ninjas have come up with an online mock test series. The mock tests for leading companies like Amazon, Microsoft, Google, Adobe, Flipkart, TCS, Wipro, and Accenture are available for free. Our team of experts has curated and designed these online mock test series to help you prepare better for your coding interview rounds. In this online test series, you will get multiple tests that include the latest coding interview questions. Start preparing for the 2021 Amazon, Microsoft, etc., tech interviews now.

Was this article helpful ?
2 upvotes

Comments

No comments yet

Be the first to share what you think