Grieve (grieve) wrote,
Grieve
grieve

Math


A while ago I posted this. I have since discovered a few things.

1. Determining the number of ways to distribute X things in Y slots is the same formula as finding the binomial coefficients as in pascals triangle.
2. The code given in the comments is not tail recursive but is linearly recursive, which makes it much harder to remove the recursion.

This isn't to say that the recursion cannot be removed, but that it is harder than removing tail recursion.
Tags: math
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments