Your favorite restaurant offers a total of 13 desserts, of which 11 have ice cream as a main ingredient and 9 have fruit as a main ingredient. Assuming that all of them have either ice cream or fruit or both as a main ingredient, how many have both?

To find out how many desserts have both ice cream and fruit as a main ingredient, we can use the principle of inclusion-exclusion.

First, we know that there are 11 desserts with ice cream and 9 desserts with fruit. However, this count includes those desserts that have both ice cream and fruit.

To get the count of desserts with both ice cream and fruit, we need to subtract the number of desserts with only one main ingredient from the total count.

To find out the number of desserts with only ice cream as a main ingredient, we subtract the number of desserts with both from the total count of ice cream desserts. So, 11 - x = number of desserts with only ice cream, where x is the number of desserts with both ice cream and fruit.

Similarly, to find out the number of desserts with only fruit as a main ingredient, we subtract the number of desserts with both from the total count of fruit desserts. So, 9 - x = number of desserts with only fruit.

Now, to find x (number of desserts with both ice cream and fruit), we can use the formula for the principle of inclusion-exclusion:

x = total count - (number of desserts with only ice cream + number of desserts with only fruit)

Total count = 13 (total number of desserts)

Number of desserts with only ice cream = 11 - x (as explained earlier)

Number of desserts with only fruit = 9 - x (as explained earlier)

Substituting these values into the formula, we get:

x = 13 - (11 - x) - (9 - x)

Simplifying further:

x = 13 - 11 + x - 9 + x

Combine like terms:

x = 13 - 11 - 9 + 2x

Add like terms and simplify:

x - 2x = 13 - 11 - 9

-x = -7

Multiplying both sides by -1:

x = 7

Therefore, there are 7 desserts that have both ice cream and fruit as main ingredients.