Notatio | Representation |
---|---|
right-aligned | |
col 2 is | centered |
zebra stripes | are neat |
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 scipy.special as special | |
from math import comb | |
K = 18 # number of sections | |
def survival_prob(r , K): | |
probability = 2 ** (-K-1) * comb(K, r-1) * special.hyp2f1(1, 1+K, 2 + K - r, 1/2) | |
return probability | |
def main(): | |
for r in range(16): | |
if r <= K: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def game_run(): | |
fell = [] | |
panes = [random.choice([[0,1], [1,0]]) for i in range(num_steps)] # 0 for breakable, 1 for solid | |
for i in range(num_players): | |
steps = [random.randint(0,1) for j in range(num_steps)] # 0 for left, 1 for right | |
for j in range(num_steps): | |
if panes[j][steps[j]] == 1: | |
panes[j] = [1, 1] | |
else: | |
panes[j] = [1, 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
import scipy.stats, math | |
mu = 8000 | |
xbar = 8100 | |
s = 580 | |
n = 40 | |
t_dist = scipy.stats.t(n-1) | |
t = (xbar - mu)/(s/math.sqrt(n)) | |
pval = 1 - t_dist.cdf(t) |
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 | |
import seaborn as sns | |
samples = np.zeros(10000) | |
mu, sigma = 20, 3 | |
for s in range(10000): | |
sample = np.random.normal(mu, sigma, 250) #sample of size 250 | |
x_bar = sample.mean() #calculating sample mean | |
samples[s] = x_bar | |
sns.distplot(samples, hist = True, color = 'darkblue', | |
hist_kws={'edgecolor':'black'}).set(xlabel = 'Sample Mean', |
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 | |
mu, sigma = 20, 3 | |
sample = np.random.normal(mu, sigma, 250) | |
x_bar = sample.mean() |
A lot of GitHub projects need to have pretty math formulas in READMEs, wikis or other markdown pages. The desired approach would be to just write inline LaTeX-style formulas like this:
$e^{i \pi} = -1$
Unfortunately, GitHub does not support inline formulas. The issue is tracked here.