> For the complete documentation index, see [llms.txt](https://datasinsightsbd.gitbook.io/dsbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://datasinsightsbd.gitbook.io/dsbook/probability/probability-lab-distribution.md).

# প্রবাবিলিটি ল্যাব-২ঃ প্রবাবিলিটি ডিস্ট্রিবিউশন

```
import matplotlib.pyplot as plt
import seaborn as sns
```

&#x20;**Bernoulli Distribution**

```
from scipy.stats import bernoulli
data_bern = bernoulli.rvs(size=10000,p=0.5)

ax= sns.distplot(data_bern,
                 kde=False,
                 color="skyblue",
                 hist_kws={"linewidth": 15,'alpha':1})
ax.set(xlabel='Bernoulli Distribution', ylabel='Frequency')
```

![](/files/-M7JXmmfwLiFh_UscTq0)

&#x20;**বারনৌলি ডিস্ট্রিবিউশন**&#x20;

```
from scipy.stats import binom
data_binom = binom.rvs(n=10,p=0.8,size=10000)

ax = sns.distplot(data_binom,
                  kde=False,
                  color='skyblue',
                  hist_kws={"linewidth": 15,'alpha':1})
ax.set(xlabel='Binomial Distribution', ylabel='Frequency')
```

![](/files/-M7JXz6kCDWB6ZOrm-JX)

**পয়সন ডিস্ট্রিবিউশন**&#x20;

```
from scipy.stats import poisson
data_poisson = poisson.rvs(mu=3, size=10000)

ax = sns.distplot(data_poisson,
                  kde=False,
                  color='skyblue',
                  hist_kws={"linewidth": 15,'alpha':1})
ax.set(xlabel='Poisson Distribution', ylabel='Frequency')
```

![](/files/-M7JYB8K-shGTKPT2-M2)

&#x20;**এক্সপোনেনশিয়াল ডিস্ট্রিবিউশন**

```
from scipy.stats import expon
data_expon = expon.rvs(scale=1,loc=0,size=1000)

ax = sns.distplot(data_expon,
                  kde=True,
                  color='skyblue',
                  hist_kws={"linewidth": 15,'alpha':1})
ax.set(xlabel='Exponential Distribution', ylabel='Frequency')
```

![](/files/-M7JYO4IXVf-Eo-BTWjp)

&#x20;**নরমাল ডিস্ট্রিবিউশন**

```
from scipy.stats import norm
# generate random numbers from N(0,1)
data_normal = norm.rvs(size=10000,loc=0,scale=1)

ax = sns.distplot(data_normal,
                  kde=True,
                  color='skyblue',
                  hist_kws={"linewidth": 15,'alpha':1})
ax.set(xlabel='Normal Distribution', ylabel='Frequency')
```

![](/files/-M7JYX8-urJARhcfq_xQ)

&#x20;**ইউনিফর্ম ডিস্ট্রিবিউশন**

```
from scipy.stats import uniform
n = 10000
start = 10
width = 20
data_uniform = uniform.rvs(size=n, loc = start, scale=width)

ax = sns.distplot(data_uniform,
                  bins=100,
                  kde=True,
                  color='skyblue',
                  hist_kws={"linewidth": 15,'alpha':1})
ax.set(xlabel='Uniform Distribution ', ylabel='Frequency')
```

![](/files/-M7JYfBl-AfvF6lPDqNH)

![](/files/-M9bhQUqJNQLFDk8sqPq)
