Wednesday, November 18, 2015

Combinations – nCr


   In the previous post on Factorials I mentioned that I needed a factorial algorithm for a Combinations project and the Combinations project for a Random Walker project.
   As you can see in the formula for the number of combinations of n things taken r at a time with no duplications there are three factorials to compute to get to the nCr.
   This is a screenshot of the Combinations project. The graphic of the fruit is to illustrate that if n = 4 (the pear, orange, banana, and strawberry) then there are four combinations (shown in the four rows) when taken 3 at a time. The project first asks for n, then r and then computes nCr.
   The project can be viewed and downloaded by clicking on this link.
   A free document in PDF format describing the coding in more detail can be obtained on request. Send an email to grandadscience@gmail.com.


1 comment:

  1. Regardless of how frequently I read it, it never gets old. You certainly hit the nail on the head on this one. This is something individuals need to think about. Your blog is really mind blowing and the design is really first class. It's important that they know how the structure of online blogs workout.

    ReplyDelete