Combinatorics Question on picking songs for playlists.

88 Views Asked by At

I have $x$ songs and I want to listen to $y$ songs (no need to be different), but I can only listen to the same song if the other $u$ songs have been played already. How many playlists can I have?

1

There are 1 best solutions below

0
On BEST ANSWER

The first $u+1$ songs cannot have any repetitions, so they can be chosen in $\frac{x!}{(x-u-1)!}$ ways. After that you may pick any song except the $u$ most recently played songs, so you always have $x-u$ choices for the next song, thus the remainder of the playlist can be created in $(x-u)^{y-u-1}$ ways. The total number of playlists is the product of these two numbers.