A company has 4 employees ranked from 1 to 4 according to experience. CEO wants to pay them salary from ranging 1 to 5 euros but only integers. To be fair with salaries, CEO wants to avoid this situation: there are three employees X, Y and Z such that X has higher rank than Y, Y has higher rank than Z, but Y is paid more than X while Z is paid more than Y. That would be unfair and must be avoided. In how many ways can the CEO still pay them?
Example:when there were 3 employees and they were paid up to 3€ each day, there were very few combinations to do this. Valid combinations starting with (1,1,1), (1,1,2) all the way to (3,3,3) were allowed. Only combination not allowed was (1,2,3). In this case, best ranked employee would get 1€, second one would get 2€ and the last one would get 3€. That would clearly break the fairness principle. So, in the early day, CEO concluded, there were 3^3 - 1 = 26 valid salary combinations
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
We can represent every combination of salaries with a quadruple ( a , b , c , d ) , where each number is between 1 and 5; also, a is the salary of the highest ranking employee, b is the salary of the second-highest ranking employee, and so on.
Let S be the set of all possible salaries, without any restrictions. Let A B C D = { ( a , b , c , d ) ∈ S : b < c < d } , = { ( a , b , c , d ) ∈ S : a < c < d } , = { ( a , b , c , d ) ∈ S : a < b < d } , = { ( a , b , c , d ) ∈ S : a < b < c } . These sets represent the combinations we want to avoid; in other words, we want to count ∣ A ∩ B ∩ C ∩ D ∣ , which we can do by applying the Principle of Inclusion-Exclusion (PIE).
By PIE, ∣ A ∩ B ∩ C ∩ D ∣ = ∣ S ∣ − ∣ A ∣ − ∣ B ∣ − ∣ C ∣ − ∣ D ∣ + ∣ A ∩ B ∣ + ∣ A ∩ C ∣ + ∣ A ∩ D ∣ + ∣ B ∩ C ∣ + ∣ B ∩ D ∣ + ∣ C ∩ D ∣ − ∣ A ∩ B ∩ C ∣ − ∣ A ∩ B ∩ D ∣ − ∣ A ∩ C ∩ D ∣ − ∣ B ∩ C ∩ D ∣ + ∣ A ∩ B ∩ C ∩ D ∣ .
It is easy to compute that ∣ S ∣ ∣ A ∣ = ∣ B ∣ = ∣ C ∣ = ∣ D ∣ ∣ A ∩ B ∣ = ∣ B ∩ C ∣ = ∣ C ∩ D ∣ ∣ A ∩ C ∣ = ∣ A ∩ D ∣ = ∣ B ∩ D ∣ ∣ A ∩ B ∩ C ∣ = ∣ A ∩ B ∩ D ∣ = ∣ A ∩ C ∩ D ∣ = ∣ B ∩ C ∩ D ∣ ∣ A ∩ B ∩ C ∩ D ∣ = 6 2 5 , = 5 0 , = 2 0 , = 5 , = 5 , = 5 , so ∣ A ∩ B ∩ C ∩ D ∣ = 6 2 5 − 4 ⋅ 5 0 + ( 3 ⋅ 2 0 + 3 ⋅ 5 ) − 4 ⋅ 5 + 5 = 4 8 5 .