Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the dynamic graph method of drawing binomial distribution by matlab python?

Shulou Source: shulou.com Published: 2022-06-01 19:37:27 09月26日 Update

This article introduces the relevant knowledge of "what is the dynamic graph method of matlab python drawing binomial distribution". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Matlab and Python are commonly used tools in data processing, probability theory is a very important foundation in quantitative model, and central limit theorem is a very important theory in probability theory.

The central limit theorem is defined as:

Let the random sequence {Xi} be independent and identically distributed, with a common mathematical expectation u and variance σ ^ 2.

Standardize the definition of Sn

Cymbals

Converge to the standard normal distribution according to the distribution. That is, for any x

Phellodendron mandshurica (Thunb.)

Phellodendron mandshurica (Thunb.)

Here Φ (x) is the distribution function of the standard normal distribution.

For binomial distribution

Cymbals

When n →∞, the distribution shape of Sn is very similar to that of normal distribution.

So, today we're going to look at the change in the shape of Sn as n grows up.

Matlab dynamic diagram:

Python dynamic diagram:

Matlab Code:

Clear all

Close all

Clc

%% binomial distribution

P = 0.6

N = 1000

Psn = zeros (1)

If 1

H3 = plot (0purn Psn)

Grid on

% axis ([0n 00.05])

Axis ([1 100 0 0.09])

For iTunes 100ln

For k = 0PUR I

Psn (KPY 1) = nchoosek (iMagol k) * (p ^ k) * ((1murp) ^ (iMurk))

End

Set (floor (iTunes 0.6)-50:floor (item0.6) + 50)

Drawnow

Grid on

Pause (0. 01)

End

End

Python Code:

#-*-coding: utf-8-*-

"

File Name: central_limit_theorem1.py

Description:

Author: Z270

Date: 2018-8-30

Change Activity:

2018-8-30:

"

Import numpy as np

From scipy.special import comb

Import matplotlib.pyplot as plt

P = 0.6

N = 1000

Psn = np.zeros (nasty 1)

Plt.figure (figsize= (8,6), dpi=80)

# turn on interactive mode

Plt.ion ()

For i in range (10010):

For k in range (iTun1):

Psn [k] = comb (imam k) * (pumped quok) * ((1MIML p) * * (iMel k))

Plt.cla ()

Plt.grid (True)

Plt.xlim (1100)

Plt.ylim (0Pol 0.09)

Plt.plot (range (1102), Psn [int (np.floor (0.6))-50:int (np.floor (0.6)) + 51], linewidth = 2.0)

Plt.pause (0.1)

Print (I)

Plt.ioff ()

The content of plt.show () "what is the dynamic graph method of matlab python drawing binomial distribution" is introduced here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Dynamic standard normal distribution method important code content theorem shape more limit probability probability theory knowledge practical from small to big learned and then from small to small function Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Technology Apple NVidia Shulou Information