search
Search
Join our weekly DS/ML newsletter layers DS/ML Guides
menu
menu search toc more_vert
Robocat
Guest 0reps
Thanks for the thanks!
close
Outline
Comments
Log in or sign up
Cancel
Post
account_circle
Profile
exit_to_app
Sign out
help Ask a question
Share on Twitter
search
keyboard_voice
close
Searching Tips
Search for a recipe:
"Creating a table in MySQL"
Search for an API documentation: "@append"
Search for code: "!dataframe"
Apply a tag filter: "#python"
Useful Shortcuts
/ to open search panel
Esc to close search panel
to navigate between search results
d to clear all current filters
Enter to expand content preview
icon_star
Doc Search
icon_star
Code Search Beta
SORRY NOTHING FOUND!
mic
Start speaking...
Voice search is only supported in Safari and Chrome.
Navigate to
A
A
brightness_medium
share
arrow_backShare
Twitter
Facebook

Combinations

Probability and Statistics
chevron_right
Probability Theory
schedule Jul 1, 2022
Last updated
local_offer Arthur
Tags
tocTable of Contents
expand_more

Combinations can be described as the number of ways we can pick a set of $k$ elements from a total $n$ elements. Unlike for permutations, we are not interested in the order of elements, only whether an element is included in the $k$ elements or not.

The formula for combinations is:

$${n \choose {k}} = \frac{n!}{k!\,(n-k)!}$$

where:

$n$: total number of elements

$k$: number of elements we want to pick

Example

How many different combinations of 2 fruits can we have from the following list of 5 (apple, orange, banana, grape, strawberry)?

Here the total number of elements / fruits is 5 (i.e. $n=5$).

We are interested in picking sets of 2 elements (i.e. $k = 2$).

$$\begin{align*} {5 \choose {2}} &= \frac{5!}{2!(5-2)!} \\ &= \frac{5!}{2!\,3!} \\ &= \frac{120}{2 * 6} \\ &= 10 \end{align*}$$

We have 10 different possible combinations:

  • apple & orange

  • apple & banana

  • apple & grape

  • apple & strawberry

  • orange & banana

  • orange & grape

  • orange & strawberry

  • banana & grape

  • banana & strawberry

  • grape & strawberry

Here "apple & orange" is treated the same as "orange & apple", which is what we mean when we say "order does not matter".

mail
Join our newsletter for updates on new DS/ML comprehensive guides (spam-free)
robocat
Published by Arthur Yanagisawa
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...
0
thumb_down
0
chat_bubble_outline
0
settings
Enjoy our search
Hit / to insta-search docs and recipes!