How many different combinations can a user make?

#1
I would like to figure how many different ways a report can be filtered.

The report shows how many different units were sold.

Filter 1: Allows users to select property state - there are 50 different choices.
Filter 2: Allows users to select color - there are 6 different colors
Filter 3: Allows users to select type - there are 4 different types

the order does not matter but users can select more than 1 choice in each of these filters. A user may want to know how many units were sold in CA and Fl that were blue or green that were type 1.

I hope I've given enough information to solve this. Thank you for helping!
 
Last edited:

Mean Joe

TS Contributor
#2
users can select more than 1 choice in each of these filters.
That explanation helps. Is there a limit to how many choices they make in a filter? Or is it actually possible to select a report with all 50 states?

It looks to me like the # of combinations is \(2^{60}\), because for each choice (50+6+4) is a yes/no possibility.
The binary possibility explains the 2, and the number of choices explains the 60.
 
#3
Thanks Mean Joe - appreciate the response.

A user can select between 1 and 50 states and all combinations in between. I don't think this problem is quite as easy as taking 2 to the 60th but I could be wrong.

for example - if we just had 2 coins, we wouldn't have 2! possibilities, we would have 3 total possibilities - one of each, both heads, or both tails.
 

Dason

Ambassador to the humans
#4
for example - if we just had 2 coins, we wouldn't have 2! possibilities, we would have 3 total possibilities - one of each, both heads, or both tails.
First off Mean Joe didn't say anything about factorial so the appropriate comparison would have been to 2^2. And 2^2 is appropriate if we're interested in the total number of possible sequences of length 2 where the outcomes are either heads or tails.

HH
HT
TH
TT

Those are the four outcomes.

In your situation there are 60 different items to filter by. You can either include the item in the filter or not. Therefore there are 2^60 different possible ways to do the filtering.
 
#5
Thanks Dason - but order doesn't matter, so HT is the same as TH. The same way as CA and blue are the same as blue and CA. make sense?

Do you concur that 2^60 is the correct answer?

thanks for your help.
 

Dason

Ambassador to the humans
#6
Yes - but you can specify an order and in this case you should. If you don't then you're considering the user specifying filtering by Wisconsin the same as Iowa (in both cases they only filtered by one state - just like how in your example you're not making a distinction between HT and TH since in each there were only one heads).

So yes I do think 2^60 is the right answer
 
#7
So Dason let me simplify this a bit for sake of illustration.

Let's say we have two possible choices, one filter contains 2 values (Red and Blue), and one filter contains 3 values (A,B, and C). Using the suggested methodology, the formula would be 2^5 which is 32.

Here are the 21 total possibilities I can come up with, where are the additional 11?

Red ABC
Red AB
Red AC
Red BC
Red A
Red B
Red C
Blue ABC
Blue AB
Blue AC
Blue BC
Blue A
Blue B
Blue C
Red and Blue ABC
Red and Blue AB
Red and Blue AC
Red and Blue BC
Red and Blue A
Red and Blue B
Red and Blue C


Order does not matter (nor should it).
 

Dason

Ambassador to the humans
#8
Ah - you didn't specify previously that the user had to choose at least one thing from each section. But that doesn't change too much.

So we just need to remove the options where you don't select anything from any of the groups.

So for your latest example the number of choices should be

(2^2 - 1)*(2^3 - 1) = 21

For your original example

(2^50 - 1)*(2^6 - 1)*(2^4 - 1) which is a big number.
 
#9
thanks, this looks like it works. To be clear, we are not saying that we are not distinguishing between Wisconsin and Iowa, we are saying that we are not distinguishing between Wisconsin and Blue vs Blue and Wisconsin - correct? It looks to me like this calculation is not considering the order - which is correct for my purposes.