In a week, Bella either eat a mango, a guava, or an apple each day. If she will not eat the same fruit for two
consecutive days, and the fruit eaten on the 1st and the last day will not repeat, how many different ways are there
for her to eat fruits?
Ignoring the final constraint it is pretty easy to see three choices on the first day and two for the other days, which gets a value of 3*2^6=192.
SO when do we get the same fruit on Day 7? I treated this like a random walk starting at 0. Each time the next fruit is chosen is either +1 or -1, equally likely.
Then by Day 7 we have 7 outcomes: +6, +4, +2, +0, -2, -4, -6. These have weighted odds: +6: 1/64, +4: 6/64, +2: 15/64, 0: 20/64, -2: 15/64, -4: 6/64, -6:1/64.
The scenarios where we end up with the same fruit are the +6, 0, and -6. And similarly we end up with a different fruit with the +4, +2, -2, and -4 cases.
Then the final answer can be computed as 192 * (6/64+15/64+15/64+6/64) = 126 different ways.