File:Birthday paradox approximation.svg

原始檔案(SVG 檔案,表面大小:720 × 450 像素,檔案大小:54 KB)


摘要

描述
English: A graph comparing the accuracy of an approximation of the probability that in a room with n people (shown along the horizontal axis), some two (or more) will share a birthday. The black line, represents the computed probability. The red line represents the approximation
Español: Comparación entre la probabilidad de que dos personas (o más) en un cuarto compartan su cumpleaños (línea negra) y la aproximación:
日期
來源 自己的作品
作者 Nicoguaro
SVG開發
InfoField
 
SVG檔案的原始碼無效,因為出現1個錯誤。
 
vector image使用Matplotlib創作。
 
The file size of this SVG plot may be irrationally large because its text has been converted to paths inhibiting translations.
原始碼
InfoField

Python code

#from __future__ import division # Python 2
import numpy as np
from scipy.special import perm
import matplotlib.pyplot as plt
from matplotlib import rcParams

rcParams['font.family'] = 'serif'
rcParams['font.size'] = 14

num = np.linspace(1, 100, 100)
p = 1 - perm(365, num)/365.**num
p_approx = 1 - np.exp(-num**2/730)

plt.figure(figsize=(8, 5))
plt.step(num, p, "k", lw=2)
plt.plot(num, p_approx, "r", lw=1)
plt.xlabel(r"Number of people - $n$")
plt.ylabel("Probability of a pair")
plt.grid(True)
plt.legend([r"Probability: $\frac{365!}{365^n (365 - n)!}$",
            r"Approximation: $1-e^\frac{-n^2}{2\cdot 365}$"], loc=4)
plt.savefig("Birthday paradox approximation.svg")
plt.show()

授權條款

我,本作品的著作權持有者,決定用以下授權條款發佈本作品:
w:zh:創用CC
姓名標示
此檔案採用創用CC 姓名標示 4.0 國際授權條款。
您可以自由:
  • 分享 – 複製、發佈和傳播本作品
  • 重新修改 – 創作演繹作品
惟需遵照下列條件:
  • 姓名標示 – 您必須指名出正確的製作者,和提供授權條款的連結,以及表示是否有對內容上做出變更。您可以用任何合理的方式來行動,但不得以任何方式表明授權條款是對您許可或是由您所使用。

說明

添加單行說明來描述出檔案所代表的內容

在此檔案描寫的項目

描繪內容

創用CC姓名標示4.0國際 繁體中文 (已轉換拼寫)

image/svg+xml

51e1f8c32f72c3e55048195ccbff1bffb3ccbff1

斷定方法:​SHA-1 中文 (已轉換拼寫)

55,676 位元組

450 像素

720 像素

檔案歷史

點選日期/時間以檢視該時間的檔案版本。

日期/時間縮⁠圖尺寸使用者備⁠註
目前2016年2月11日 (四) 16:09於 2016年2月11日 (四) 16:09 版本的縮圖720 × 450(54 KB)NicoguaroUser created page with UploadWizard

下列頁面有用到此檔案:

全域檔案使用狀況

以下其他 wiki 使用了這個檔案:

詮釋資料