File:Birthday paradox approximation.svg
From Wikimedia Commons
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 720 × 450 pixels. Other resolutions: 320 × 200 pixels | 640 × 400 pixels | 1,024 × 640 pixels | 1,280 × 800 pixels | 2,560 × 1,600 pixels.
Original file (SVG file, nominally 720 × 450 pixels, file size: 54 KB)
File information
Structured data
Captions
Summary[edit]
DescriptionBirthday paradox approximation.svg |
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: |
Date | |
Source | Own work |
Author | Nicoguaro |
SVG development InfoField | This W3C-invalid plot was created with Matplotlib. |
Source code 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()
|
Licensing[edit]
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 16:09, 11 February 2016 | 720 × 450 (54 KB) | Nicoguaro (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage
The following page uses this file:
Global file usage
The following other wikis use this file:
- Usage on de.wikipedia.org
- Usage on en.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on pt.wikipedia.org
- Usage on sq.wikipedia.org
- Usage on th.wikipedia.org
- Usage on tr.wikipedia.org
- Usage on uk.wikipedia.org
- Usage on zh.wikipedia.org
Metadata
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
Width | 576pt |
---|---|
Height | 360pt |