Probability? Problem...little help

Hi all-
I was hoping for a little help on finding a solution to this problem. Actually, I'm not as worried about the solution as much as how to arrive at the solution. I tried asking the math department at my school but no one was willing or able to help out so I figured I would try here. Thanks in advance. Any info on how to solve it would be helpful. Here is the problem...

I need to pick one team from each of the following groups. I cannot pick more than 5 AFC teams. I cannot pick more than 5 NFC teams. How many combinations of teams can I pick from?

Group 1
NFC-Atlanta Falcons
NFC-New Orleans Saints
AFC-New England Patriots
NFC-Green Bay Packers

Group 2
NFC-Dallas Cowboys
NFC-Arizona Cardinals
AFC-Oakland Raiders
AFC-Indianapolis Colts

Group 3
AFC-San Diego Chargers
AFC-Pittsburgh Steelers
AFC-Buffalo Bills
NFC-Washington Redskins

Group 4
AFC-Kansas City Chiefs
AFC-Tennessee Titans
NFC-Carolina Panthers
NFC-Philadelphia Eagles

Group 5
AFC-Miami Dolphins
NFC-Seattle Seahawks
NFC-Tampa Bay Buccaneers
NFC-Detroit Lions

Group 6
AFC-Baltimore Ravens
AFC-Denver Broncos
NFC-Minnesota Vikings
AFC-Cincinnati Bengals

Group 7
AFC-Jacksonville Jaguars
NFC-New York Giants
NFC-San Francisco 49ers
AFC-Houston Texans

Group 8
NFC-Chicago Bears
AFC-New York Jets
AFC-Cleveland Browns
NFC-Los Angeles Rams

Thanks again for any help anyone can offer. Again, I'm not as worried about the actual answer as I am how to find it. I'd like to be able to do the calculation on my own if the groups were shuffled.
I should also include that if the groups were to be reshuffled, it would be possible for a group to be made up of ALL AFC teams or ALL NFC teams.


Less is more. Stay pure. Stay poor.
this in not my forte, but I will spew a little information to keep the thread moving.

So the question is how many combinations exist when you have 8 groups, each having 4 members and you select one member from each of the groups. Now how many of these combinations have less then 6 AFC or 6 NFC. You also have varied probabilities within each group.

The total number of combinations can be answered using the product rule, multiple numbers per groups, so there are 4x4x4x4x4x4x4x4=combinations you could have I believe 65,536 different combinations of 8 teams. No how many have fewer than 6 teams from a division? Hmm
Thanks for the reply! I was able to get that far, figuring out the MAX # of possiblilities if you did not have to abide by the "no more than 5 AFC/NFC" rule. I could also calculate the answer if the # of AFC/NFC teams in each group was consistent. Since it's not, that's where I'm running into trouble moving forward.

Thanks again for the reply. Hopefully, someone else can provide some insight on how to address the changing number of AFC/NFC teams in each group.


Ambassador to the humans
I'm not sure there is a nice clean way to do it. If you wanted to do it analytically you might be able to map out something like "For choosing 3 AFC teams there are 56 ways to do that" then look at the 56 group combinations and figure out how many combinations you can make for each combination of groups

... but you'd have to do that for 4 AFC teams and 5AFC teams as well. And that could be quite tedious. You might be able to save some time by using the fact that there are 2 groups that only have 1 AFC team, 4 that have 2, and 2 that have 3 AFC teams but that's an exercise left for the reader.

Honestly the total number of possibilities is a bit too large to count by hand cleanly but it isn't too large that a computer can't do it basically instantly.

I wrote some R code that basically enumerates all of the possibilities and then figures out which ones meet the criteria and gives the total. I put the code and the result it gives in the spoiler below.

n <- 0 # n will represent NFC team
a <- 1 # a will represent AFC team
# We don't actually need to care about which specific team - just whether they're NFC or AFC.

groups <- list(g1 = c(n,n,a,n),
               g2 = c(n,n,a,a),
               g3 = c(a,a,a,n),
               g4 = c(a,a,n,n),
               g5 = c(a,n,n,n),
               g6 = c(a,a,n,a),
               g7 = c(a,n,n,a),
               g8 = c(n,a,a,n))

# This will get every possible combination from the groups
combs <-, groups)
# This will figure out how many AFC teams are in each combination
num_afc <- rowSums(combs)

# Since we can't have more than 5 AFC and can't have more than 5 NFC
# the only options are to have 3, 5, or 5 AFC teams.  So
# we really just want the number of rows that have a sum
# of 3,4,5 since we're representing AFC with 1
sum(num_afc %in% c(3,4,5))
# Answer is: 48992

Combinatorics is a great subject but sometimes it's just not worth it and having a computer do the hard work is a much nicer approach.
Not homework. I participate in a football pool that operates under these rules. In the pool, no two entries can be alike. Some people had picks rejected and had to re-pick to find a unique combination so we were all wondering how many actual combinations were available this year.

The pool manager also wanted to be able to calculate the number of options each year with new groups. The groups get shuffled each year based on the number of points scored by each team the previous season.

I do work at a high school and sent it to our entire math department and no one was willing or able to come up with an answer. I appreciate you helping out. I hope you don't feel like I've wasted your time with something silly like this but it has satisfied the curiosity of a handful of people who were curious to know. Thanks!


Ambassador to the humans
Honestly I prefer helping out on questions that aren't homework and are just something that somebody is curious about. If you want to run the code I posted you just need to download R. It's a free open-source programming language so you shouldn't have any issues with cost or anything like that. I tried coming up with a relatively simple way to mimic the approach I took in the code in Excel but it was harder coming up with a "create all possible combinations" type of thing without resorting to VBA or some kind of plugin than I would have hoped so... I'm not gonna do that for you haha.
Just downloaded R and was playing around...I'm in the technology dept. I've at least figured out how to tweak your script for the pool's needs. I appreciate the comments you added. Our CS teacher compliments your code and says it is very "clean".


Ambassador to the humans
Thanks! I could have made it a bit nicer but it was just a one-off script so didn't care too much about all the nitty gritty details. R does make doing simulations, statistical modeling, and stuff like what we did here quite easy so if you're interested in this kind of stuff it wouldn't be a bad language to learn a bit more about. For instance if you were wondering what the probability of getting the same number of combinations if somewhere were to randomly shuffle the teams into groups.... that would be something that would be very easy to simulate and get a decent approximation on in R.