This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(13, 7, 7, 9, 10, 7, 8, 12, 9, 29), 6-5 vs. 9 (100): hit, not double | |
(16, 17, 13, 14, 15, 12, 12, 12, 13, 60), 10-2 vs. 2 (100): stand, not hit | |
(14, 16, 18, 20, 13, 18, 16, 14, 18, 56), 6-1 vs. 3 (100): double, not hit | |
(11, 13, 14, 17, 9, 12, 12, 10, 11, 46), 9-3 vs. 5 (100): stand, not hit | |
(7, 12, 13, 15, 8, 9, 9, 10, 6, 41), 3-6 vs. 3 (100): hit, not double | |
(6, 10, 9, 14, 8, 8, 9, 10, 5, 40), 2-10 vs. 2 (100): stand, not hit | |
(3, 5, 9, 11, 6, 7, 8, 7, 4, 29), 6-3 vs. 2 (100): double, not hit | |
(24, 24, 24, 24, 24, 24, 24, 24, 24, 96), 2-10 vs. 4 (100): hit, not stand | |
(17, 21, 18, 17, 17, 20, 17, 20, 18, 67), 4-8 vs. 5 (100): hit, not stand | |
(9, 12, 13, 9, 11, 12, 13, 10, 9, 57), 7-3 vs. 10 (100): hit, not double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
00:00:00.000 == 00:00:00.000 | |
00:05:02.097 == 01:00:25.174 | |
00:10:04.195 == 02:00:50.349 | |
00:15:06.293 == 03:01:15.524 | |
00:20:08.391 == 04:01:40.699 | |
00:25:10.489 == 05:02:05.874 | |
00:30:12.587 == 06:02:31.048 | |
00:35:14.685 == 07:02:56.223 | |
00:40:16.783 == 08:03:21.398 | |
00:45:18.881 == 09:03:46.573 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "blackjack_pdf.h" | |
#include <iostream> | |
int main() | |
{ | |
int num_decks = 6; | |
bool h17 = false; | |
bool das = true; | |
bool ls = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mode = 2 | |
# Convert integer to words. | |
if mode == 0: | |
units = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', | |
'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', | |
'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'] | |
tens = ['zero', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', | |
'seventy', 'eighty', 'ninety'] | |
powers = ['zero', 'thousand', 'million', 'billion', 'trillion', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
units = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', | |
'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', | |
'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'] | |
tens = ['zero', 'ten', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', | |
'seventy', 'eighty', 'ninety'] | |
powers = ['zero', 'thousand', 'million', 'billion', 'trillion', | |
'quadrillion', 'quintillion', 'sextillion', 'septillion', 'octillion', | |
'nonillion', 'decillion'] | |
hundred = 'hundred' | |
minus = 'minus' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 [1] | |
2 [1, 2] | |
3 [1] | |
4 [3] | |
5 [] | |
6 [] | |
7 [] | |
8 [6] | |
9 [] | |
10 [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def sample(): | |
"""Return number of random Skittles packs opened until first duplicate.""" | |
packs = set() | |
count = 0 | |
while len(packs) == count: | |
packs.add(tuple(np.bincount( | |
np.random.randint(0, 5, np.random.binomial(100, 0.6))))) | |
count = count + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ref: https://gist.github.com/skeeto/1718d6613dc47a7aff13333942a40776 | |
*/ | |
static long long | |
valid(long long x) | |
{ | |
int v = 0; | |
long long a = transpose(x); | |
v += x == a; | |
a = flipv(a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* https://possiblywrong.wordpress.com/2015/02/08/searching-for-chocolates/ *) | |
d[n_, k_] := If[! (0 <= k <= n), 0, | |
Sum[ | |
(-1)^j Binomial[k, j] (n - j)!, | |
{j, 0, k} | |
] | |
] | |
v[n_, k_] := v[n, k] = Which[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://possiblywrong.wordpress.com/2015/02/08/searching-for-chocolates/ | |
#include "math_Rational.h" // https://github.com/possibly-wrong/precision | |
#include <vector> | |
#include <map> | |
#include <iterator> | |
#include <algorithm> | |
#include <numeric> | |
#include <iostream> | |
#include <ctime> |
OlderNewer