POWER BI: Modeling

Statistical Functions

Permutation and Combination functions
PERMUT(n,k)

Returns the number of ways k objects can be selected from n without replacement where the order of the selected objects matters.

Example:

A basket of fruit contains an apple, an orange and a banana. Find the number of ways I can pick 2 fruit out of the basket where the order is important.

This is easy enough to list out by hand:

  • {apple,orange,}
  • {apple,banana}
  • {orange, banana}
  • {orange,apple}
  • {banana,apple}
  • {banana,orange}

The order is important: ie. The set {apples, oranges} is counted as a different set than {oranges,apples}

Using POWER BI write:

                  permutations = PERMUT(3,2)
	            

COMBIN(n,k)

Returns the number of ways k objects can be selected from n where the order does NOT matter.

Example:

A basket of fruit contains an apple, an orange and a banana. Find the number of ways I can pick 2 fruit out of the basket where the order does not matter.

  • {apple,orange,}
  • {apple,banana}
  • {orange, banana}

Using POWER BI write:

                  combinations = COMBIN(3,2)  
	            
Lottery Example:

You purchase one lotto 6-49 ticket. The win the jackpot, you need to guess 6 numbers from 49. What are the odd?

Using POWER BI write:

                  combinations = COMBIN(49,6)  
	            

That returns about 14 million different combinations. So the odds are approx. 1 in 14 million. The order of drawing 6 numbers correctly does not matter. If the order did matter, you would need to mutliply the number of combinations by 6! So the odds would go down to 1 in 10,068,347,520. In otherwords, it would take a really long time to get a winner.

The relationship between Permutations and Combinations:

Permutations and Combinations are related as follows:

                    PERMUT(n,k) = COMBIN(n,k) * FACT(k)
	            
  • Where FACT(k) is the factorial function in POWER BI

Mathematically the relationship is given as:

PERMUT(n,k) = $ \dfrac{n!}{(n-k)!}$

COMBIN(n,k) = $ \dfrac{n!}{(n-k)!k!}$

Dash-Intel is a Power BI and Tableau resource site for data visualization and building BI dashboards.

Data Analyst & Consultant

Copyright 2015-2023 Dash-Intel.com Terms