קובץ:Largenumbers.svg

מתוך testwiki
קפיצה לניווט קפיצה לחיפוש
לקובץ המקורי (קובץ SVG, הגודל המקורי: 600 × 480 פיקסלים, גודל הקובץ: 25 ק"ב)
הצגת תמונה זו בשפה .

זהו קובץ מתוך ויקישיתוף וניתן להשתמש בו גם במיזמים אחרים. תיאורו בדף תיאור הקובץ שלו מוצג למטה.

תקציר

תיאור
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התפתחות 
InfoField
 .קוד המקור של קובץ SVG זה הוא תקין
 Java עם‎‎ נוצרה ה גרפיקה וקטורית
 ו עם GNUPLOT.
  This file is translated using SVG switch elements: all translations are stored in the same file.


קובץ זה מתורגם באמצעות SVG <switch> elements. כל התרגומים מאוחסנים באותו קובץ! למידע נוסף.

עבור רוב מיזמי ויקיפדיה, אתה יכול להטמיע את הקובץ באופן רגיל (ללא פרמטר lang). ויקיפדיה תשתמש בשפה שלה אם קובץ ה-SVG תומך בשפה זו. לדוגמה, ויקיפדיה הגרמנית תשתמש בגרמנית אם לקובץ ה-SVG יש גרמנית. כדי להטביע קובץ זה בשפה מסוימת השתמש בפרמטר lang עם קוד השפה המתאים, למשל. [[File:Largenumbers.svg|lang=he]] עבור הגרסה העברית. אל תציין פרמטר lang אם אין בו צורך. הפרמטר עשוי למנוע את השימוש בתרגום עוקב.

כדי לתרגם את הטקסט לשפה שלך, אתה יכול להשתמש בכלי תרגום SVG. לחלופין, אתה יכול להוריד את הקובץ למחשב שלך, להוסיף את התרגומים שלך באמצעות כל תוכנה שאתה מכיר, ולהעלות אותו מחדש באותו שם. תוכל למצוא עזרה במעבדת הגרפיקה אם אינך בטוח כיצד לעשות זאת.

Source code

זהו הלוגו של: Java – שפת תכנות
זהו הלוגו של: Java – שפת תכנות
This media was created with Java (שפת תכנות)
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 הקובץ הזה זמין לפי תנאי ההקדשה עולמית לנחלת הכלל CC0 1.0 של קריאייטיב קומונז.
האדם ששייך יצירה להיתר הזה הקדיש את היצירה לנחלת הכלל על־ידי ויתור על כל הזכויות שלו או שלה על היצירה בכל העולם לפי חוק זכויות יוצרים, לרבות כל הזכויות הקשורות או הסמוכות כקבוע בחוק. באפשרותך להעתיק, לשנות, להפיץ, או להציג את היצירה, אפילו למטרות מסחריות, וכל זה אפילו מבלי לבקש רשות.

ביאורים
InfoField
תמונה זו מוערת: הצג את ההערות בויקישיתוף

כיתובים

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

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

מוצג

image/svg+xml

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

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

תאריך/שעהתמונה ממוזערתממדיםמשתמשהערה
נוכחית07:54, 15 בנובמבר 2024תמונה ממוזערת לגרסה מ־07:54, 15 בנובמבר 2024‪480 × 600‬ (25 ק"ב)wikimediacommons>Dr. GreywolfFile uploaded using svgtranslate tool (https://svgtranslate.toolforge.org/). Added translation for yue.

הדף הבא משתמש בקובץ הזה: