How many different programs can it play?
How many different programs are there if the three pieces can be played in any order?
How many different three-piece programs are there if more than one piece from the same category can be played and they can be played in any order?
# Following are the three symphonies
Haydn <- 30
modernworks <- 15
Beethoven <- 9
total_prog <- Haydn*modernworks*Beethoven
total_prog
## [1] 4050
Following combinations can be possible:
Set1:Haydn,Modern,Beethoven Set2:Haydn,Beethoven,Modern Set3:Beethoven,Modern,Haydn Set4:Beethoven,Haydn,Modern Set5:Modern,Beethoven,Haydn Set6:Modern,Haydn,Beethoven
Since there are 6 possible way
possible_prog <- 6 * total_prog
possible_prog <- 6 * 4050
possible_prog
## [1] 24300
sum <- Haydn + modernworks + Beethoven
total_ways<- factorial(sum)/factorial(sum-3)
total_ways
## [1] 148824