日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

使用python学线性代数_二项式过程| 使用Python的线性代数

發布時間:2025/3/11 python 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用python学线性代数_二项式过程| 使用Python的线性代数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

使用python學線性代數

When we flip a coin, there are two possible outcomes as head or tail. Each outcome has a fixed probability of occurrence. In the case of fair coins, heads and tails each have the same probability of 1/2. In addition, there are cases in which the coin is biased, so that heads and tails have different probabilities of occurrence. Coin toss experiment for number of n trails can be called as a binomial distribution.

當我們擲硬幣時,有兩個結果可能是正面還是反面。 每個結果都有固定的發生概率。 對于公平硬幣,正面和反面的概率分別為1/2。 此外,在某些情況下,硬幣會有偏差,因此正面和反面的出現概率不同。 n次追蹤的硬幣折騰實驗可以稱為二項分布 。

As per Wikipedia Definition: In probability theory and statistics, the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in a sequence of n independent experiments, each asking a yes–no question, and each with its own boolean-valued outcome: success/yes/true/one (with probability p) or failure/no/false/zero (with probability q = 1 ? p). A single success/failure experiment is also called a Bernoulli trial or Bernoulli experiment and a sequence of outcomes is called a Bernoulli process; for a single trial, i.e., n = 1, the binomial distribution is a Bernoulli distribution. The binomial distribution is the basis for the popular binomial test of statistical significance.

根據Wikipedia的定義 : 在概率論和統計學中,參數n和p的二項式分布是n個獨立實驗序列中成功次數的離散概率分布,每個獨立實驗詢問一個是非問題,每個實驗都有其自己的布爾值結果:成功/是/正確/一個(概率為p)或失敗/否/錯誤/零(概率為q = 1-p)。 一個成功/失敗的實驗也稱為伯努利試驗或伯努利實驗,一系列結果稱為伯努利過程。 對于單項試驗,即n = 1,二項式分布是伯努利分布。 二項式分布是流行的具有統計意義的二項式檢驗的基礎。

Here, we will learn to create a binomial distribution using python with Probability parameter p = 0.1.

在這里,我們將學習使用概率參數p = 0.1的 python創建二項分布。

二項式過程的Python代碼 (Python code for Binomial Process)

# Linear Algebra Learning Sequence # Binomial Processimport pylab as pl# defining factorial function k = 0 def fact(num):facto = 1while num>0:facto = facto*numnum = num - 1return facto # print(fact(5)) #// for checking# Defining power function def exp(num,po):ex = 1while po>0:ex = ex*numpo = po - 1return ex # print(exp(2,8)) #// for checking# Implementation of Binomial Process # Probability of K arrivals with # probability of arrival as pr # not arrival probability is 1-pr # P = n!/(n-r)!*r! * p^r * (1-p)^n-r # r = kdef Binomial(N,k,pr):BinCoef = (fact(N)/(fact(N-k)*fact(k)))ProRatio = (exp(pr,k)*exp(1-pr,N-k))Probability = BinCoef*ProRatioreturn ProbabilityN = 1 n = 1 k = 1 pr = 0.1 prn = 0.9# Use of Vector to save data and # further algebric manipulation x = [] y = []while n<40:x.append(n)y.append(Binomial(n,k,pr))n = n + 1pl.plot(x,y)print('Binomial Process Vector : ', y)

Output:

輸出:

Binomial Process Vector : [0.1, 0.18000000000000002, 0.24300000000000005, 0.2916, 0.32805000000000006, 0.3542940000000001, 0.37200870000000014, 0.3826375200000001, 0.38742048900000015, 0.3874204890000002, 0.3835462841100002, 0.37657271530800024, 0.36715839742530026, 0.3558612159660602, 0.3431518868244152, 0.32942581135143856, 0.3150134321048131, 0.3001892705939984, 0.2851798070642985, 0.27017034353459857, 0.25531097464019564, 0.24072177608932738, 0.22649730750223074, 0.2127105148716602, 0.19941610769218143, 0.18665347679988184, 0.17444921100912034, 0.16281926360851232, 0.1517708135779347, 0.14130386091738747, 0.13141259065317037, 0.1220865358326228, 0.11331156606965304, 0.10507072490095098, 0.09734493630529284, 0.09011359817975681, 0.08335507831627505, 0.07704712644369205, 0.07116721416246292]

翻譯自: https://www.includehelp.com/python/binomial-process.aspx

使用python學線性代數

總結

以上是生活随笔為你收集整理的使用python学线性代数_二项式过程| 使用Python的线性代数的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。