The formula for the number of ways to arrange n objects is n! = n * (n ??? 1) * · · · * 2 * 1. This exercise walks you through the derivation of this formula for a couple of special cases. A small company has five employees: Anna, Ben, Carl, Damian, and Eddy. There are five parking spots in a row at the company, none of which are assigned, and each day the employees pull into a random parking spot. That is, all possible orderings of the cars in the row of spots are equally likely.
Answer: If we are choosing the parking lot in an alphabetical order, then there will be one straight pattern. 5 cars parked in 5 places.
So, it can be denoted as 5!.
factorial <- factorial(5)
probability <- 1/factorial
print(probability)
## [1] 0.008333333
The probabilty is 0.8333%
Answer: Since there are 5 cars and 5 places, you can find it by just finding the 5!
random_order_parking <- factorial(5)
print(random_order_parking)
## [1] 120
Answer: If there are 8 employees,then we can find the factorial of 8!
factorial = factorial(8)
print(factorial)
## [1] 40320