File:Birthday paradox.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Size of this PNG preview of this SVG file: 575 × 291 pixels. Other resolutions: 320 × 162 pixels | 640 × 324 pixels | 1,024 × 518 pixels | 1,280 × 648 pixels | 2,560 × 1,296 pixels.
Original file (SVG file, nominally 575 × 291 pixels, file size: 188 KB)
File information
Structured data
Captions
Summary
[edit]DescriptionBirthday paradox.svg | Vector version of Image:050329-birthday1.png |
Date | |
Source | Own work |
Author | Toobaz |
Permission (Reusing this file) |
GFDL |
SVG development InfoField | This W3C-invalid plot was created with Matplotlib. |
Source code InfoField | Python codedef inv_prob(n):
if n == 0:
return 1
if n > 365:
return 0
return inv_prob(n-1)*(1-(n-1.)/365)
def probarray():
arr=[]
for people in range(364):
arr.append(1-inv_prob(people))
return arr
def qrobarray():
arr=[0]
for people in range(399):
arr.append(1-((1-arr[people])*(1-1./365)))
return arr
plot(qrobarray())
plot(probarray(),'g.')
text(200,.5,'q(n)', color='blue')
text(35,.6,'p(n)', color='green')
|
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following licenses:
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International, 3.0 Unported, 2.5 Generic, 2.0 Generic and 1.0 Generic 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.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
You may select the license of your choice.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 02:40, 7 March 2008 | 575 × 291 (188 KB) | Toobaz (talk | contribs) | {{Information |Description=Vectorial version of Image:050329-birthday1.png |Source=self-made |Date=07 Mar 2008 |Author= Toobaz |Permission= GFDL }} Made with pylab (started with "ipython -pylab). Here is the code: def inv_prob(n): |
You cannot overwrite this file.
File usage on Commons
The following page uses this file:
File usage on other wikis
The following other wikis use this file:
- Usage on bs.wikipedia.org
- Usage on de.wikipedia.org
- Usage on el.wikipedia.org
- Usage on en.wikipedia.org
- Usage on fa.wikipedia.org
- Usage on hy.wikipedia.org
- Usage on lt.wikipedia.org
- Usage on nl.wikipedia.org
- Usage on ru.wikipedia.org
- Usage on uk.wikipedia.org
- Usage on zh.wikipedia.org