Skip to content

Instantly share code, notes, and snippets.

@behrouz-bakhtiari
behrouz-bakhtiari / README-Template.md
Created June 9, 2018 06:35 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Problem

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.

Investigation

import numpy as np
mu, sigma = 20, 3
sample = np.random.normal(mu, sigma, 250)
x_bar = sample.mean()
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)
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',
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]
Notatio Representation
$r$ right-aligned
col 2 is centered
zebra stripes are neat
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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: