How many ways can these basketball players be organized?

I found the following math problem online:

Bill, Ernie, Oscar, Sammy, and Tony are the five basketball players on the starting team of the varsity squad. Each one is known by a different one of these five nicknames: Slats, Stretch, Tiny, Tower, and Tree. From the information given, determine the nickname of each player as well as each of their heights, whether $6^{\prime} 6^{\prime \prime}, 6^{\prime} 5^{\prime \prime}, 6^{\prime} 3^{\prime \prime}, 6^{\prime} 1^{\prime \prime}$, or $6^{\prime}$ tall.

  1. Oscar is taller than Tree who is taller than Tony.
  2. Bill is taller than Sammy but shorter than Slats.
  3. Tony's nickname is not Tiny.
  4. Stretch is taller than Oscar but not the tallest.

[![enter image description here][1]][1]

  • There are 5 basketball players
  • Each of these players has a nickname
  • Each of these players has a height measurement

In this problem, you have to assign each basketball player to his correct nickname and height.

I was curious to know how many possible combinations can be made using this information. For example:

  • Combinations 1 : Bill = Slats, Ernie = Stretch, Oscar = Tiny, Sammy = Tiny and Tony = Tree. Bill is 6'6, Ernie is 6'5, Oscar is 6'3, Sammy is 6'1 and Tony is 6'.

  • Combinations 2 : Bill = Stretch, Ernie = Slats, Oscar = Tiny, Sammy = Tiny and Tony = Tree. Bill is 6'6, Ernie is 6'5, Oscar is 6'3, Sammy is 6'1 and Tony is 6'.

  • Combinations 3 : Bill = Stretch, Ernie = Slats, Oscar = Tiny, Sammy = Tiny and Tony = Tree. Bill is 6'6, Ernie is 6'5, Oscar is 6'3, Sammy is 6 and Tony is 6'1.

  • etc.

Using the R programming language, I first found out how many ways the heights of the basketball players can be ranked (120 ways):

my_list = c("Bill", "Ernie", "Oscar", "Sammy", "Tony")

d = permn(my_list)

all_combinations  = as.data.frame(matrix(unlist(d), ncol = 120)) |>
  setNames(paste0("col", 1:120))


data_frame_version = data.frame(matrix(unlist(d), ncol = length(d))

matrix_version = matrix(unlist(d), ncol = length(d)) 

#first 20 rows of matrix version:

     [,1]    [,2]    [,3]    [,4]    [,5]    [,6]    [,7]    [,8]    [,9]    [,10]   [,11]   [,12]   [,13]   [,14]   [,15]   [,16]   [,17]   [,18]   [,19]  
[1,] "Bill"  "Bill"  "Bill"  "Bill"  "Tony"  "Tony"  "Bill"  "Bill"  "Bill"  "Bill"  "Bill"  "Bill"  "Bill"  "Bill"  "Tony"  "Tony"  "Sammy" "Sammy" "Sammy"
[2,] "Ernie" "Ernie" "Ernie" "Tony"  "Bill"  "Bill"  "Tony"  "Ernie" "Ernie" "Ernie" "Sammy" "Sammy" "Sammy" "Tony"  "Bill"  "Sammy" "Tony"  "Bill"  "Bill" 
[3,] "Oscar" "Oscar" "Tony"  "Ernie" "Ernie" "Ernie" "Ernie" "Tony"  "Sammy" "Sammy" "Ernie" "Ernie" "Tony"  "Sammy" "Sammy" "Bill"  "Bill"  "Tony"  "Ernie"
[4,] "Sammy" "Tony"  "Oscar" "Oscar" "Oscar" "Sammy" "Sammy" "Sammy" "Tony"  "Oscar" "Oscar" "Tony"  "Ernie" "Ernie" "Ernie" "Ernie" "Ernie" "Ernie" "Tony" 
[5,] "Tony"  "Sammy" "Sammy" "Sammy" "Sammy" "Oscar" "Oscar" "Oscar" "Oscar" "Tony"  "Tony"  "Oscar" "Oscar" "Oscar" "Oscar" "Oscar" "Oscar" "Oscar" "Oscar"

Then, I found out how many ways nicknames can be assigned to each player (25 ways):

    list.a <- as.list(c("Bill", "Ernie", "Oscar", "Sammy", "Tony"))
    
    list.b <- as.list(c("Slats", "Stretch", "Tiny", "Tower", "Tree"))
    
    result.df <- expand.grid(list.a, list.b)
    Var1    Var2
1   Bill   Slats
2  Ernie   Slats
3  Oscar   Slats
4  Sammy   Slats
5   Tony   Slats
6   Bill Stretch
7  Ernie Stretch
8  Oscar Stretch
9  Sammy Stretch
10  Tony Stretch
11  Bill    Tiny
12 Ernie    Tiny
13 Oscar    Tiny
14 Sammy    Tiny
15  Tony    Tiny
16  Bill   Tower
17 Ernie   Tower
18 Oscar   Tower
19 Sammy   Tower
20  Tony   Tower
21  Bill    Tree
22 Ernie    Tree
23 Oscar    Tree
24 Sammy    Tree
25  Tony    Tree   

But from here, I am not sure how to find out how many possible combinations there are in this problem. Can someone please help me with this?

Thanks!


Solution 1:

I don't think your R code solution of 25 yields the number of group assignments of nicknames to players. $5\times 5$ is the number of ways to choose one particular (name, nickname) combination, sort of like the number of outfits you can form with 5 shirts and 5 pants.

Instead, I think what you want is as follows. Imagine lining up the 5 players and you distribute labels with their nicknames and then their heights. There are 5 choices of nicknames for the first player, 4 for the next, etc. so there are $5!$ nickname assignments. Likewise, there are $5!$ height assignments. Those assignments are independent, so in total there are $(5!)^2=14,400$ nickname-height assignments.