Датотека:Largenumbers.svg

Извор: testwiki
Пређи на навигацију Пређи на претрагу
Оригинална датотека (SVG датотека, номинално 600 × 480 пиксела, величина: 25 kB)
Рендеруј ову слику у .

Ова датотека се налази на Викимедијина остава и може да се користи на другим пројектима. Њен опис је приказан испод.

Опис

Опис
Català: Una il·lustració de la llei dels grans nombres, semblant a 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 law of large numbers, similar to 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.
Датум
Извор Сопствено дело
Аутор NYKevin
Остале верзије
SVG genesis
InfoField
 The SVG code is valid.
 This vector image was created with Јава.
 and with GNUPLOT.
  This file is translated using SVG switch elements: all translations are stored in the same file.


Датотека је преведена користећи SVG <switch> елементе. Сви преводи се чувају у истој датотеци! Сазнајте више.

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.

Да преведете текст на Ваш језик, можете користити SVG Translate tool. Други начин је преузимање датотеке и превођење исте помоћу Вама познатог софтвера и реаплоудовање исте под истим именом. Ако нисте сигурни како све ово урадити, помоћ можете наћи на Graphics Lab-у.

Source code

Ово је лого: Јава – објектно-оријентисани програмски језик
Ово је лого: Јава – објектно-оријентисани програмски језик
This media was created with Јава (објектно-оријентисани програмски језик)
Here is a listing of the source used to create this file.

Deutsch  English  +/−

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]);

Лиценцирање

NYKevin, носилац ауторског права над овим делом, објављује исто под следећом лиценцом:
Creative Commons CC-Zero Ова датотека је доступна под лиценцом Creative Commons 1.0 Универзална – посвећивање јавном власништву.
Особа која је учествовало у раду на овом документу посветила је дело јавном власништву, одричући се свих права на то дело широм света, по закону о ауторским правима и повезаним или сродним законским правима које би имао/имала, у мери дозвољеној законом. Можете да умножавате, мењате, расподељујете и прилагођавате дело, чак и у комерцијалне сврхе, без тражења дозволе.

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

Поднаписи

Укратко шта ова датотека представља/приказује

Ставке приказане у овој датотеци

приказује

31. јануар 2010

image/svg+xml

Историја датотеке

Кликните на датум/време да бисте видели тадашњу верзију датотеке.

Датум/времеМинијатураДимензијеКорисникКоментар
тренутна07:54, 15. новембар 2024.Минијатура за верзију на дан 07:54, 15. новембар 2024.600 × 480 (25 kB)wikimediacommons>Dr. GreywolfFile uploaded using svgtranslate tool (https://svgtranslate.toolforge.org/). Added translation for yue.

Следећа страница користи ову датотеку: