50 children had a choice of beans, plantain and rice. 21 of them took rice, 24 took plantain and 18 took rice. 3 took beans only, 9 took plantain only , 2 took rice only and 5 took all three items of food

To find the number of children who took each type of food, we can use the principle of inclusion-exclusion.

Let's denote:
R = number of children who took rice,
B = number of children who took beans,
P = number of children who took plantain.

From the given information, we know that:
R = 21,
P = 24,
R = 18.

We also know that:
The number of children who took beans only = B - (number of children who took all three items) - (number of children who took beans and plantain only) - (number of children who took beans and rice only).
The number of children who took plantain only = P - (number of children who took all three items) - (number of children who took beans and plantain only) - (number of children who took plantain and rice only).
The number of children who took rice only = R - (number of children who took all three items) - (number of children who took beans and rice only) - (number of children who took plantain and rice only).

Since 5 children took all three items, we subtract this from the total:
Total = 50 - 5 = 45.

Using the given information, we can set up the following equations:
B - 5 - (number of children who took beans and plantain only) - (number of children who took beans and rice only) = 3,
24 - 5 - (number of children who took beans and plantain only) - (number of children who took plantain and rice only) = 9,
21 - 5 - (number of children who took beans and rice only) - (number of children who took plantain and rice only) = 2.

Simplifying these equations, we get:
B - (number of children who took beans and plantain only) - (number of children who took beans and rice only) = 8,
19 - (number of children who took beans and plantain only) - (number of children who took plantain and rice only) = 9,
14 - (number of children who took beans and rice only) - (number of children who took plantain and rice only) = 2.

By adding these three equations together, we get:
B - (number of children who took beans and plantain only) - (number of children who took beans and rice only) + 19 - (number of children who took beans and plantain only) - (number of children who took plantain and rice only) + 14 - (number of children who took beans and rice only) - (number of children who took plantain and rice only) = 8 + 9 + 2,
B - (number of children who took beans and plantain only) - (number of children who took beans and rice only) - (number of children who took beans and plantain only) - (number of children who took plantain and rice only) - (number of children who took beans and rice only) - (number of children who took plantain and rice only) + 19 + 14 = 8 + 9 + 2.

This simplifies to:
B - 2(number of children who took beans and plantain only) - 2(number of children who took beans and rice only) - 2(number of children who took plantain and rice only) + 33 = 19.

Moving all the terms to one side, we have:
B - 2(number of children who took beans and plantain only) - 2(number of children who took beans and rice only) - 2(number of children who took plantain and rice only) = 19 - 33 = -14.

This equation tells us that the sum of the children who took beans, took beans and plantain only, took beans and rice only, and took plantain and rice only is -14. However, this is not physically possible, so there must be an error in the given information or calculations.