Answer: The average was 9 years old find the average age of both groups is 10 years old.
Explanation:
Formula foe average :

Given : The first group of students consists of 10 and their average age was 13 years old.
i.e.
(1)
The next group consisted of 30 students and their average was 9 years old.
i.e.
(2)
Then from (1) and (2) , the sum of both groups (first group and next group )students = 130+270 =400
Combined students of both groups (first and next group )= 10+30=40
Now , the average of both groups =


Hence, the average was 9 years old find the average age of both groups is 10 years old.