I suspect a more elegant solution is possible, but anyway1) During 6 days of the week (from monday to saturday), a young man spends two afternoons in front of the computer, two in front of the TV and two in front of the video game. He spends the whole afternoon in front of only one equipment. Considering he doesn't spend two consecutive afternoons in front of the same equipment, in how many different ways can he program the 6 afternoons of his week (i.e., attributing equipments to the 6 aternoons)?

Call the equipment used on the first day A, the equipment used on the second day B and the equipment not used in the first 2 days C.

If A is used on the third day then the remaining 3 days are CBC, giving 1 possibility.

If C is used on the 3rd day then A or B can be used on the 4th day and there remain C and A or B (whichever was not used on the 4th) for the fifth day. This gives 2X2 = 4 possibilities.

Add this to the 1 from before and multiply by the number of permutations of equipment as A, B and C

partition the set by the number of days on which he drinks one of each soda.2) A young man drinks two soda bottles in each one of the afternoons from monday to saturday. Supposing he buys 6 identical bottles of soda brand A and 6 identical bottles of soda brand B, determine the number of ways to distribute the 12 bottles in the 6 days (two a day).

Edit: Ignore this, it doesn't work because It only counts distributions where all As are next to another A

You can add a B or a C to the end each distribution of size n-1 or AA to the end of each distribution with size n-2, giving the recursion