לדלג לתוכן

קובץ:Paradoxe anniversaire.svg

תוכן הדף אינו נתמך בשפות אחרות.
מתוך ויקיפדיה, האנציקלופדיה החופשית

לקובץ המקורי(קובץ SVG, הגודל המקורי: 720 × 540 פיקסלים, גודל הקובץ: 52 ק"ב)

ויקישיתוף זהו קובץ שמקורו במיזם ויקישיתוף. תיאורו בדף תיאור הקובץ המקורי (בעברית) מוצג למטה.

תקציר

תיאור
Français : Le paradoxe des anniversaires, dû à Richard von Mises, est à l'origine une estimation probabiliste du nombre de personnes que l'on doit réunir pour avoir une chance sur deux que deux personnes de ce groupe aient leur anniversaire le même jour de l'année. Il se trouve que ce nombre est 23, ce qui choque un peu l'intuition. À partir d'un groupe de 57 personnes, la probabilité est supérieure à 99 %.
English: In probability theory, the birthday problem or birthday paradox concerns the probability that, in a set of n randomly chosen people, some pair of them will have the same birthday. By the pigeonhole principle, the probability reaches 100% when the number of people reaches 367 (since there are 366 possible birthdays, including February 29). However, 99% probability is reached with just 57 people, and 50% probability with 23 people. These conclusions are based on the assumption that each day of the year (except February 29) is equally probable for a birthday.
תאריך יצירה
מקור נוצר על־ידי מעלה היצירה
יוצר Guillaume Jacquenot
SVGהתפתחות 
InfoField
 
.קוד המקור של קובץ SVG זה הוא תקין
 
Matplotlib עם‎‎ נוצרה ה גרפיקה וקטורית
קוד מקור
InfoField

Python code

# -*- coding: utf-8 -*-
#
# Script to generate in English and French, graphs for the
# birthday problem.
#
# **************************************************************
# http://en.wikipedia.org/wiki/Birthday_problem
# From Wikipedia, the free encyclopedia:
# In probability theory, the birthday problem or birthday
# paradox concerns the probability that, in a set of n
# randomly chosen people, some pair of them will have the
# same birthday. By the pigeonhole principle (Principe des tiroirs), 
# the probability reaches 100% when the number of people reaches
# 367 (since there are 366 possible birthdays, including February
# 29). However, 99% probability is reached with just 57 people,
# and 50% probability with 23 people. These conclusions are
# based on the assumption that each day of the year (except
# February 29) is equally probable for a birthday.
#
# The mathematics behind this problem led to a well-known
# cryptographic attack called the birthday attack, which
# uses this probabilistic model to reduce the complexity
# of cracking a hash function.
#
# Text under the
# Creative Commons Attribution-ShareAlike License
# **************************************************************
#
#
# Guillaume Jacquenot
# 2012/12/16

from pylab import *
import numpy as np

def makePlot(
        generateEnglishPlot = True,
        outputFilename = r'Birthday_paradox.svg',
        useYLogScale = False):
    N=91
    n = np.arange(float(N))
    pbar=np.exp(-n* (n-1) / (2.0*365.0))
    p=1.0-pbar

    n05 = 0.5*(1.0+np.sqrt(1-8.0*365.0*np.log(1.0-0.5)))
    plot([n05,n05],[0.0,0.5],c='k', linestyle='--')
    plot([0.0,n05],[0.5,0.5],c='k', linestyle='--')
    text(23.5,0.02,' ~23')
    if generateEnglishPlot:
        plot(n,p   ,c='r',label = unicode('Probability of a pair', 'utf8'))
        plot(n,pbar,c='b',label = unicode('Probability of no matching pair', 'utf8'))
    else:
        plot(n,p   ,c='r',label = unicode('Probabilité de coïncidence', 'utf8'))
        plot(n,pbar,c='b',label = unicode('Probabilité de non-coïncidence', 'utf8'))

    legend(loc='right')
    xlim(0, N)
    if useYLogScale:
        ylim(1e-6, 1)
        ax = gca()
        ax.set_yscale('log')
    else:
        ylim(0, 1)
        yticks([0.0,0.2,0.4,0.5,0.6,0.8,1.0])
    xticks(range(0, N, 10))
    grid(True, ls='-', c='#a0a0a0')
    if generateEnglishPlot:
        xlabel('Number of people')
        ylabel('Probability')
    else:
        xlabel('Nombre de personnes')
        ylabel(unicode('Probabilité', 'utf8'))
    savefig(outputFilename)
    show()

makePlot(generateEnglishPlot = True, outputFilename = r'Birthday_paradox.svg')
makePlot(generateEnglishPlot = False, outputFilename = r'Paradoxe_anniversaire.svg')

רישיון

אני, בעל זכויות היוצרים על עבודה זו, מפרסם בזאת את העבודה תחת הרישיון הבא:
w:he:Creative Commons
ייחוס שיתוף זהה
הקובץ הזה מתפרסם לפי תנאי רישיון קריאייטיב קומונז ייחוס-שיתוף זהה 3.0 לא מותאם.
הנכם רשאים:
  • לשתף – להעתיק, להפיץ ולהעביר את העבודה
  • לערבב בין עבודות – להתאים את העבודה
תחת התנאים הבאים:
  • ייחוס – יש לתת ייחוס הולם, לתת קישור לרישיון, ולציין אם נעשו שינויים. אפשר לעשות את זה בכל צורה סבירה, אבל לא בשום צורה שמשתמע ממנה שמעניק הרישיון תומך בך או בשימוש שלך.
  • שיתוף זהה – אם תיצרו רמיקס, תשנו, או תבנו על החומר, חובה עליכם להפיץ את התרומות שלך לפי תנאי רישיון זהה או תואם למקור.

כיתובים

נא להוסיף משפט שמסביר מה הקובץ מייצג

פריטים שמוצגים בקובץ הזה

מוצג

היסטוריית הקובץ

ניתן ללחוץ על תאריך/שעה כדי לראות את הקובץ כפי שנראה באותו זמן.

תאריך/שעהתמונה ממוזערתממדיםמשתמשהערה
נוכחית23:51, 16 בדצמבר 2012תמונה ממוזערת לגרסה מ־23:51, 16 בדצמבר 2012‪540 × 720‬ (52 ק"ב)GjacquenotUser created page with UploadWizard

אין בוויקיפדיה דפים המשתמשים בקובץ זה.

שימוש גלובלי בקובץ

אתרי הוויקי השונים הבאים משתמשים בקובץ זה:

מטא־נתונים