Let the pets be P1, P2, P3, P4, P5, P6
The treats are: A (apple slice), A (apple slice), B (banana), C (carrot), M (mango), P (pear).
There are 6 treats and 6 pets, so each pet gets exactly one treat.
The two apple slices are identical.
Given condition:
The (Pr)rabbit does NOT get the mango, AND the (Pp)parrot does NOT get the banana.
Now lets solve:
First, let's assign the non-apple treats (B, C, M, P) and then the apples(A,A)
Total ways to distribute 6 distinct items to 6 distinct pets is 6!=720.
However, since two apple slices are identical, we divide by 2! for the apples: 6!/2!=720/2=360.
Let N be the total number of ways to distribute the treats (360).
Let A be the set where the rabbit gets the mango.
Let B be the set where the parrot gets the banana.
We want to find N−∣A∪B∣=N−(∣A∣+∣B∣−∣A∩B∣).
lets calculate N (Total ways without restrictions on who gets what):
We have 6 pets and 6 distinct positions for the treats (since pets are distinct).
The treats are (A, A, B, C, M, P).
The number of ways to arrange these treats for the pets is 6!/2!=720/2=360.
lets calculate |A| (Rabbit gets Mango):
If the rabbit gets the mango, assign M to Pr
Now we have 5 treats left (A, A, B, C, P) and 5 pets left.
Number of ways = 5!/2!=120/2=60.
lets calculate |B| (Parrot gets Banana):
If the parrot gets the banana, assign B to Pp
Now we have 5 treats left (A, A, C, M, P) and 5 pets left.
Number of ways = 5!/2!=120/2=60.
now calculate |A intersect B| (Rabbit gets Mango AND Parrot gets Banana):
Assign M to Pr and B to Pp
Now we have 4 treats left (A, A, C, P) and 4 pets left.
Number of ways = 4!/2!=24/2=12.
Therefore, number of valid ways = N−(∣A∣+∣B∣−∣A∩B∣)
=360−(60+60−12)
=360−(120−12)
=360−108
=252