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个问题。
 
本W3C无效的矢量图使用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:知识共享
署名
本文件采用知识共享署名 4.0 国际许可协议授权。
您可以自由地:
  • 共享 – 复制、发行并传播本作品
  • 修改 – 改编作品
惟须遵守下列条件:
  • 署名 – 您必须对作品进行署名,提供授权条款的链接,并说明是否对原始内容进行了更改。您可以用任何合理的方式来署名,但不得以任何方式表明许可人认可您或您的使用。

说明

添加一行文字以描述该文件所表现的内容

此文件中描述的项目

描繪內容

image/svg+xml

51e1f8c32f72c3e55048195ccbff1bffb3ccbff1

55,676 字节

450 像素

720 像素

文件历史

点击某个日期/时间查看对应时刻的文件。

日期/时间缩⁠略⁠图大小用户备注
当前2016年2月11日 (四) 16:092016年2月11日 (四) 16:09版本的缩略图720 × 450(54 KB)NicoguaroUser created page with UploadWizard

以下页面使用本文件:

全域文件用途

以下其他wiki使用此文件:

元数据