Skeda:Largenumbers.svg

Page contents not supported in other languages.
Nga Wikipedia, enciklopedia e lirë

Dokument origjinal(skedë SVG, fillimisht 600 × 480 pixel, madhësia e skedës: 25 KB)

Shfaqe këtë imazh në .
Kjo skedë është prej Wikimedia Commons dhe mund të përdoret nga projekte të tjera. Përshkrimi në këtë skedë në këtë faqe nuk është treguar më poshtë. Shko tek faqja përshkruese në Commons Shko tek faqja përshkruese në Commons

Përmbledhje

 
W3C-validity not checked.
 
This W3C-unspecified plot was created with Gnuplot.
Përshkrimi
Català: Una il·lustració de la llei dels grans nombres, semblant a File:LLN_Die_Rolls.gif però utilitzant el format svg en comptes de gif. Això utilitza dades diferents i, per tant, sembla diferent. El codi font es troba a la secció següent. El codi està sota la mateixa "llicència" que l'obra en si.
English: An illustration of the w:law of large numbers, similar to File:LLN_Die_Rolls.gif but using the svg format instead of gif. This uses different data from that and hence it looks different. Source code is in the section below. The code is under the same "license" as the work itself.
Data (UTC)
Burimi Punë e juaja
Autori NYKevin
Versione tjera
Other related versions:File:LLN_Die_Rolls.gif
Translate this file

Kjo skedë SVG përdor tekst i cili mund të përkthehet fare lehtë në gjuhën tënde përmes [toolforge:svgtranslate/File:Largenumbers.svglink këtij mjeti] në mënyrë automatike. Lexo më tepër. Gjithashtu ju mund ta shkarkoni këtë skedar dhe ta redaktoni manualisht përmes një tekst-editori.

Ky skedar përkthehet me anë të elementëve SVG <switch>. Të gjitha përkthimet ruhen në të njëjtin skedar! Mëso më shumë

For most Wikipedia projects, you can embed the file normally (without a lang parameter). The Wikipedia will use its language if the SVG file supports that language. For example, the German Wikipedia will use German if the SVG file has German. To embed this file in a particular language use the lang parameter with the appropriate language code, e.g. [[File:Largenumbers.svg|lang=en]] for the English version. Do not specify a lang parameter if it is not needed. The parameter may prevent the use of a subsequent translation.

To translate the text into your language, you can use the SVG Translate tool. Alternatively, you can download the file to your computer, add your translations using whatever software you're familiar with, and re-upload it with the same name. You will find help in Graphics Lab if you're not sure how to do this.

Source code

Note that you will need to insert some paths. I've tried to make it obvious where to do so.

This code is all in the public domain (the cc0 waiver applies to it)

The code (in Java) which generated the data:

import java.io.*;
public class Main {
    public static void main(String[] args) {
        PrintStream output=null;
        try{
            output=new PrintStream("");//FIXME Insert a suitable path in the quote marks
        }catch(FileNotFoundException e){
            throw new RuntimeException(e);
        }
        //int diceValues[] = {0,0,0,0,0,0};//this variable may be uncommented and used for debugging
        double average=0;
        double total=0;
        output.println("#count average");//makes a header for the data; may be safely removed
        Random rnd=new Random(4124484382302655524l);
        //seed selected by trial and error
        for(int i=1;i<=1000;i++){
            int rand=rnd.nextInt(6);//now holds a random int from 0 to 5
            //diceValues[rand]++;//uncomment for debugging
            rand++;//convert to 1-indexed
            total+=rand;
            average=total/i;
            output.println(i+" "+(average));
        }
        //System.out.println(average);
    }

}

The gnuplot code:

set terminal svg
set output "OUTPUT PATH HERE"
set title "average dice value against number of rolls"
set xlabel "trials"
set ylabel "mean value"
plot [] [1:6] "PATH FROM JAVA CODE HERE" title "average" with lines, 3.5 title "y=3.5" with lines
#it is recommended that you copy and paste this code into a .plt file and run it in batch mode:
#If you must run this interactively, be sure to type "exit" or ^D (control-D) at the end,
#or gnuplot will leave off the </svg> closing tag.

MATLAB/Octave Source code

% Specify how many trials you want to run:
num_trials = 1000;

% Now grab all the dice rolls:
trials = randi(6, [1 num_trials]);

% Plot the results:
figure(1);

% Cumulative sum of the trial results divided by the index gives the
% average:
plot(cumsum(trials)./(1:num_trials), 'r-');

% Let's put a reference line at 3.5 just for fun (make the color a darker
% green as well):
hold on;
plot([1 num_trials], [3.5 3.5], 'color', [0 0.5 0]);

% Make it look pretty:
title('average dice value against number of rolls');
xlabel('trials');
ylabel('mean value');
legend('average', 'y=3.5');
axis([0 num_trials 1 6]);


Licencim

Creative Commons CC-Zero Kjo skedë është bërë e mundur nën Creative Commons CC0 1.0 Universal Public Domain Dedication.
Personi që lidhi një punë me këtë vepër ia ka dedikuar punën public domain duke shmangur të gjitha të drejtat e tij apo të saj për punën në mbarë botën nën ligjin e të drejtës së autorit, duke përfshirë të gjitha të drejtat e lidhura dhe fqinje, deri në masën e lejuar me ligj. Ju mund ta kopjoni, modifikoni, shpërndani dhe të kryeni pune, madje edhe për qëllime komerciale, të gjitha pa kërkuar leje.

Annotations
InfoField
This image is annotated: View the annotations at Commons

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

përshkruan

31 janar 2010

Historiku skedës

Shtypni mbi një datë/kohë për ta parë skedën siç ishte atëherë.

Data/KohaMiniaturëPërmasatPërdoruesiKoment
e tanishme31 janar 2024 23:28Miniaturë për versionin duke filluar nga 31 janar 2024 23:28600 × 480 (25 KB)ManlleusFile uploaded using svgtranslate tool (https://svgtranslate.toolforge.org/). Added translation for ca.
3 shkurt 2010 04:53Miniaturë për versionin duke filluar nga 3 shkurt 2010 04:53600 × 480 (22 KB)NYKevinIn the interest of replicability, this one was generated using a known PRNG seed value. Will update Java source. Also, this one has axis labels!
1 shkurt 2010 01:53Miniaturë për versionin duke filluar nga 1 shkurt 2010 01:53600 × 480 (21 KB)NYKevinBetter version, with better Java code (more precise). Will update source soon.
1 shkurt 2010 01:35Miniaturë për versionin duke filluar nga 1 shkurt 2010 01:35600 × 480 (21 KB)NYKevinI mixed up x and y in the legend, will update gnuplot source code in a moment (already checked for svg closing tag).
1 shkurt 2010 01:08Miniaturë për versionin duke filluar nga 1 shkurt 2010 01:08600 × 480 (21 KB)NYKevinApparently gnuplot forgot the <svg> closing tag?
1 shkurt 2010 01:06S’ka miniaturë (21 KB)NYKevinTrying again... looks like the last one had a problem?
1 shkurt 2010 01:04S’ka miniaturë (21 KB)NYKevin{{Information |Description={{en|1=An illustration of the w:law of large numbers, similar to File:LLN_Die_Rolls.gif but using the svg format instead of gif. This uses different data from that and hence it looks different. I will include source c

Këto faqe lidhen tek kjo skedë:

Përdorimi global i skedës

Kjo skedë përdoret nga Wiki të tjera në vijim:

Metadata