File:Somme tirages des polyedriques.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 514 × 396 pixels, file size: 42 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
Français : Fréquence d'apparition des valeurs pour la somme de tirage de dés polyédriques à 4, 6, 8, 10, 12 et 20 faces (d4 + d4 + d8 + d10 + d12 + d20). Illustration du théorème central limite.
English: Frequency of occurrence of values for the sum of 4-, 6-, 8- 10- 12 and 20-sided polyheral dice (d4 + d4 + d8 + d10 + d12 + d20). Illustration of the central limit theorem.
Date
Source Own work
Author Cdang

Scilab source

// Trace la fonction de densité de la moyenne de n tirages à pile ou face

// initialisation

clear;

des = [4, 6, 8, 10, 12, 20]; // liste des dés

N = prod(des); // nombre de tirages possibles
n = size(des, "c"); // nombre de dés

resultats = zeros(N, 1); // initialisation : résultats des tirages

nb_cases = N*n;
k = N; // pour chaque dé i, k est la taille d'une séries de valeurs identiques
l = 1; // pour chaque dé i, l est le nombre de séries
tic();
for i = 1:n // i-ème dé
    d = des(i);
    k = k/d;
    for j = 1:l // j-ième série
        indice_debut = (j-1)*k*d + 1
        for m = 1:d // valeur m du dé
            id1 = indice_debut + (m-1)*k;
            resultats(id1:id1+k-1) = resultats(id1:id1+k-1) + m;
        end
    end
    l = l*d;
end
disp(toc());

somme = resultats(:,1);
frequences_non_triees = tabul(somme);
frequences = gsort(frequences_non_triees, "lr", "i");
frequences(:,2) = frequences(:,2)/N; // normalisation des fréquences

// Programme principal

f1 = figure(1);
clf;

plot2d(frequences(:,1), frequences(:,2))

xtitle(["Tirages de dés polyédriques" ; "d4 + d6 + d8 + d10 + d12 + d20"],...
"Valeurs de la somme", "Fréquence")

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current11:41, 18 June 2013Thumbnail for version as of 11:41, 18 June 2013514 × 396 (42 KB)Cdang (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata