I hereby claim:
- I am phsteve on github.
- I am katz (https://keybase.io/katz) on keybase.
- I have a public key whose fingerprint is 1D0C 64CA 0D92 3DFC 297A 5D43 ECD4 3433 A588 AE06
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #n is the total amount, L is the list of change denominations. | |
| def change(n, L): | |
| if n < 0: | |
| return 0 | |
| if n == 0: | |
| return 1 | |
| if L == []: | |
| return 0 | |
| return change(n, L[:-1]) + change(n-L[-1], L) |
| #The Collatz sequence is defined by the following rules on the set of positive numbers: | |
| # n -> n/2 if n is even | |
| # n -> 3n + 1 if n is odd | |
| #Starting with 13, the sequence proceeds: | |
| # 13 - 40 - 20 - 10 - 5 - 16 - 8 - 4 - 2 - 1 | |
| #Which starting number, under 1,000,000 produces the longest chain? |
| #!/usr/bin/python | |
| #This is a program to calculate payouts for horse racing. The user is prompted | |
| #for the names of the horses, then the names of the bettors, then for any number | |
| #of bets. At the end, it displays the winnings of each bettor. | |
| #It uses parimutuel-style betting, where the odds for each horse are calculated | |
| #by dividing the total amount bet on all the horses by the amount bet on the | |
| #specific horse. The people who have bet on a winning horse divide up all the | |
| #money bet in proportion to the relative amount of their respective bets on the |