Giter Club home page Giter Club logo

dsc-1-08-13-combinations-online-ds-sp-000's Introduction

Combinations

Introduction

In the previous section, you learned about how to apply permutations. Permutations come in handy when we want to know how many ways we can order sets. Now what if order is not important? That's where combinations come in.

Objectives

You will be able to:

  • Understand how combinations are used when the order is not important
  • Be able to use and interpret the mathematical formula of combinations

Why combinations?

In some settings, the order of the selection is not important.

Let's go back to our "Who's bad" example. Imagine that the Michael Jackson cover band is playing 3 songs out of their 8 song repertoire. How many ways can they select songs, assuming that the order of the chosen songs is not important? Here, we just want to know which three songs they play, and not which song goes first, second and last.

We can use a backward rationale here. We know that when order did matter, our answer was $876$. When having three elements, there are 6 possible orders (ABC, ACB, CAB, CBA, BAC, BCA), so we get to the answer by dividing our previous answer by 6.

This type of problem setting can be solved by using combinations. In general, combinations answer the question: "how many ways can we create a subset $k$ out of $n$ objects?". The subset is not ordered.

$$\displaystyle\binom{n}{k} = \dfrac{P_{k}^{n}}{k!}=\dfrac{ \dfrac{n!}{(n-k)!}}{k!} = \dfrac{n!}{(n-k)!k!}$$

Note how 6 in our Michael Jackson example $= 6 = 3!$, as expected.

Summary

In this section, you learned what combinations are and how to use them. let's put this knowledge into practice!

dsc-1-08-13-combinations-online-ds-sp-000's People

Contributors

loredirick avatar peterbell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.