<jupyter_start><jupyter_text>Normal Distribution<jupyter_code>#probability of values less than 8

sct.norm.cdf(8, loc=10, scale=3)
#probability of values less than 10

sct.norm.cdf(10, loc=10, scale=3)
#generates a CDF chart

x = np.linspace(0, 20, num=1000)

f = lambda x: sct.norm.cdf(x, loc=10, scale=3)

cdf = f(x)

sns.lineplot(x, cdf);
#probability of numbers greater than 8

sct.norm.sf(8, loc=10, scale=3)
#value for accumulated probability 80%

sct.norm.ppf(0.8, loc=10, scale=3)
#quantile for cumulative probability greater than 25#

sct.norm.isf(0.25, loc=10, scale=3)
#probability density

sct.norm.pdf(8, loc=10, scale=3)
#generates the pdf chart

x = np.linspace(0, 20, num=1000)

f = lambda x: sct.norm.pdf(x, loc=10, scale=3)

cdf = f(x)

sns.lineplot(x, cdf);<jupyter_output><empty_output><jupyter_text>Binominal Distribution<jupyter_code>binom_20_05 = sct.binom.rvs(20, 0.5, size=100000) # Mean 10, variance 5.
binom_20_07 = sct.binom.rvs(20, 0.7, size=100000) # Mean 14, variance 4.2.

sns.distplot(binom_20_05, bins=range(4, 18), kde=False, hist_kws={"alpha": 0.9});
sns.distplot(binom_20_07, bins=range(8, 22), kde=False, hist_kws={"alpha": 0.5});<jupyter_output><empty_output><jupyter_text>Most of the functions available for the normal distribution that we present are also available for the binomial distribution:mean(): $\mathbb{E}[X]$var(): $\text{Var}[X]$rvs(): $\vec{X}$ cdf(): $P(X \leq x)$sf(): $P(X &gt; x)$ ppf(): $x$ such that $P(X \leq x) = p$isf(): $x$ such that $P(X &gt; x) = p$The only significant change is in the pmf () ($ P (X = x) $) function, which was normally called pdf () ($ f (x) $).  What is the probability of obtaining a maximum of 3 heads (successes) in 20 launches of an addicted coin, which is $0.10 likely to be expensive?<jupyter_code>sum((sct.binom.pmf(i, 20, 0.10) for i in range(4)))
sct.binom.cdf(3, 20, 0.10)<jupyter_output><empty_output><jupyter_text>How likely are we to get at least 10 successes out of 20 releases of the same flawed coin above?<jupyter_code>1 - sum((sct.binom.pmf(i, 20, 0.10) for i in range(10)))
1 - sct.binom.cdf(9, 20, 0.10)
sct.binom.sf(9, 20, 0.10)<jupyter_output><empty_output><jupyter_text>How likely are we to get at least 50 successes out of 200 launches of an addicted currency that has a probability of success of $0.3?<jupyter_code>1 - sct.binom.cdf(49, 200, 0.30)
1 - sct.norm.cdf(50, 60, sqrt(42)) # Y ~ N(60, 42).
1 - sct.binom.cdf(9, 20, 0.10)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15898058252427186, 'fraction_numerical': 0.07524271844660194, 'mean_word_length': 5.2292191435768265, 'pattern_counts': {'":': 2, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '428839', 'license': 'MIT', 'n_tokens_mistral': 1140, 'n_tokens_neox': 996, 'n_words': 283, 'path': 'Main.ipynb', 'repo_name': 'robertosousa1/probability-distribution', 'size': '2472'}