Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

initial commit

  • Loading branch information...
commit c577f52609a6c756fa913aae0600fa7af48848be 0 parents
@rok authored
Showing with 5,112,091 additions and 0 deletions.
  1. +22 −0 .gitattributes
  2. +163 −0 .gitignore
  3. +1 −0  README
  4. +247 −0 latex/mafi1.tex
  5. +283 −0 latex/mcode.sty
  6. BIN  latex/slike/plot1.png
  7. BIN  latex/slike/plot2.png
  8. BIN  latex/slike/plot5.png
  9. BIN  latex/slike/plot6.png
  10. BIN  mafi1.pdf
  11. +29 −0 octave/arunup.m
  12. +32 −0 octave/demo.m
  13. +16 −0 octave/genpoiss.m
  14. +12 −0 octave/genpoiss.py
  15. +64 −0 octave/nrunup2.m
  16. +22 −0 octave/nrunups2.m
  17. BIN  octave/octave-core
  18. +16 −0 octave/plot1.m
  19. +11 −0 octave/plot2.m
  20. +25 −0 octave/ploto.m
  21. +35 −0 octave/ploto2.m
  22. +10 −0 octave/podatki/arunup.txt
  23. +10 −0 octave/podatki/arunupc.txt
  24. +10 −0 octave/podatki/nrunups2.txt
  25. +10 −0 octave/podatki/nrunups3.txt
  26. +1,000,000 −0 octave/podatki/numpyPoiss.txt
  27. +1,000,000 −0 octave/podatki/octaveCustomPoiss.txt
  28. +1,000 −0 octave/podatki/octaveCustomPoissTru.txt
  29. +1,000,000 −0 octave/podatki/octavePoiss.txt
  30. +100,000 −0 octave/podatki/phpCustomPoiss.txt
  31. +1,000,001 −0 octave/podatki/phpRand.txt
  32. +1,000,000 −0 octave/podatki/randPoissR.txt
  33. +10,000 −0 octave/podatki/trunrnd.txt
  34. +9 −0 octave/rand2.m
  35. +41 −0 octave/urnd2poissrnd.m
  36. +22 −0 octave/zap.m
22 .gitattributes
@@ -0,0 +1,22 @@
+# Auto detect text files and perform LF normalization
+* text=auto
+
+# Custom for Visual Studio
+*.cs diff=csharp
+*.sln merge=union
+*.csproj merge=union
+*.vbproj merge=union
+*.fsproj merge=union
+*.dbproj merge=union
+
+# Standard to msysgit
+*.doc diff=astextplain
+*.DOC diff=astextplain
+*.docx diff=astextplain
+*.DOCX diff=astextplain
+*.dot diff=astextplain
+*.DOT diff=astextplain
+*.pdf diff=astextplain
+*.PDF diff=astextplain
+*.rtf diff=astextplain
+*.RTF diff=astextplain
163 .gitignore
@@ -0,0 +1,163 @@
+#################
+## Eclipse
+#################
+
+*.pydevproject
+.project
+.metadata
+bin/
+tmp/
+*.tmp
+*.bak
+*.swp
+*~.nib
+local.properties
+.classpath
+.settings/
+.loadpath
+
+# External tool builders
+.externalToolBuilders/
+
+# Locally stored "Eclipse launch configurations"
+*.launch
+
+# CDT-specific
+.cproject
+
+# PDT-specific
+.buildpath
+
+
+#################
+## Visual Studio
+#################
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.sln.docstates
+
+# Build results
+[Dd]ebug/
+[Rr]elease/
+*_i.c
+*_p.c
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.vspscc
+.builds
+*.dotCover
+
+## TODO: If you have NuGet Package Restore enabled, uncomment this
+#packages/
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opensdf
+*.sdf
+
+# Visual Studio profiler
+*.psess
+*.vsp
+
+# ReSharper is a .NET coding add-in
+_ReSharper*
+
+# Installshield output folder
+[Ee]xpress
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish
+
+# Others
+[Bb]in
+[Oo]bj
+sql
+TestResults
+*.Cache
+ClientBin
+stylecop.*
+~$*
+*.dbmdl
+Generated_Code #added for RIA/Silverlight projects
+
+# Backup & report files from converting an old project file to a newer
+# Visual Studio version. Backup files are not needed, because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+
+
+
+############
+## Windows
+############
+
+# Windows image file caches
+Thumbs.db
+
+# Folder config file
+Desktop.ini
+
+
+#############
+## Python
+#############
+
+*.py[co]
+
+# Packages
+*.egg
+*.egg-info
+dist
+build
+eggs
+parts
+bin
+var
+sdist
+develop-eggs
+.installed.cfg
+
+# Installer logs
+pip-log.txt
+
+# Unit test / coverage reports
+.coverage
+.tox
+
+#Translations
+*.mo
+
+#Mr Developer
+.mr.developer.cfg
+
+# Mac crap
+.DS_Store
1  README
@@ -0,0 +1 @@
+Runs test for poisson random number generator. A homework for Mathematical physics 1.
247 latex/mafi1.tex
@@ -0,0 +1,247 @@
+\documentclass{article}[12pt]
+
+\usepackage{graphicx}
+\usepackage[slovene]{babel}
+\usepackage{psfrag}
+\usepackage{epsf}
+\usepackage{amsmath,amsfonts,amssymb,latexsym}
+\usepackage{enumitem}
+\usepackage[width=175mm,height=260mm,left=20mm,foot=10mm]{geometry}
+\usepackage[utf8]{inputenc}
+\usepackage{setspace}
+\usepackage{epstopdf}
+\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
+\usepackage{float}
+%\doublespacing
+
+
+\newtheorem{izrek}{Izrek}
+\newtheorem{posledica}[izrek]{Posledica}
+\newtheorem{lema}[izrek]{Lema}
+\newtheorem{trditev}[izrek]{Trditev}
+\newtheorem{domneva}[izrek]{Domneva}
+\newtheorem{problem}[izrek]{Problem}
+\newtheorem{vprasanje}[izrek]{Vprasanje}
+\newtheorem{definicija}[izrek]{Definicija}
+\newtheorem{opomba}[izrek]{Opomba}
+
+
+\title{Matematična Fizika 1, domača naloga:\\
+Preizkus generatorja slučajnih števil porazdeljenih po Poissonovi porazdelitvi}
+
+ \author{
+ \textsc{Rok Mihevc} \\[0.25em]
+ {\small{Fakulteta za matematiko in fiziko}} \\[-0.25em]
+ {\small{Univerza v Ljubljani}} \\[-0.25em]
+ {\small\texttt{rok@mihevc.org}}
+ }
+
+\date{\today}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Author's definitions
+
+
+\newenvironment{dokaz}%
+{\noindent{\bf Dokaz.}\ }%
+{\hfill$\Box$\par\bigskip}%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% mno?ice in funkcije
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand{\dfnc}[3]{#1:#2\rightarrow #3}
+\newcommand{\dset}[2]{\left\{#1 \:|\: #2\right\}}
+\newcommand{\lset}[2]{\left\{#1, \ldots, #2\right\}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% ?tevilske mno?ice
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\newcommand{\NN}{\mathbb N}
+\newcommand{\ZZ}{\mathbb Z}
+\newcommand{\QQ}{\mathbb Q}
+\newcommand{\RR}{\mathbb R}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% posebne prilagoditve ukazov
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\newcommand{\cali}[1]{{\cal #1}}
+\def\thx{\vartheta}
+\def\epx{\varepsilon}
+\def\rhx{\varrho}
+\def\phx{\varphi}
+
+\newcommand{\textem}[1]{{\sl #1}}
+
+\renewcommand\a{\alpha}
+\renewcommand\b{\beta}
+\renewcommand\d{\delta}
+\newcommand\D{\Delta}
+
+\begin{document}
+
+\maketitle
+
+
+\section{Uvod}
+
+Za preskus generatorjev slučajnih števil uporabljajo tudi takoimenovani »run-up« test: v danem vzorcu števil preštejemo, koliko je v njem striktno naraščajočih (padajočih) nizov z dolžino M. Izračunamo pričakovane vrednosti števila nizov z dolzino 1, 2, 3, ..., v naključnem vzorcu 1 milijon števil, porazdeljenih po Poissonovi porazdelitvi. (Slika \ref{plot1})
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=17cm]{slike/plot1}
+\caption{Poissonova porazdelitev}
+\label{plot1}
+\end{center}
+\end{figure}
+
+\section{Analitični izračun}
+
+\subsection{Poissonova porazdelitev}
+
+Poissonova porazdelitev je diskretna verjetnostna porazdelitev, ki nam poda \textit{verjetnost danega števila dogodkov N, v danem prostorskem ali časovnem intervalu, pri znani pogostosti teh dogodkov $\bar{N}$}.\\
+Izpeljemo jo iz binomske verjetnostne porazdelitve kot njen limitni primer.\\
+\[
+P(N) = e^{-\bar{N}} \cdot \frac{\bar{N}^N}{N!}
+\]
+Kumulativno verjetnost pa zapišemo kot:
+
+\[
+F(N) = e^{-\bar{N}} \cdot \sum_{i=0}^{N} \frac{\bar{N}^i}{i!}
+\]
+
+Za potrebe te naloge se bomo zaradi preprostosti omejili na primer $\bar{N}=1$.
+
+\subsection{Verjetnost monotono naraščajočega zaporedja}
+
+Odločimo se da bom preučili nize števil, ki strogo naraščajo ($N_2 > N_1$).
+Ko iz poissonove naključne porazdelitve zajamamemo vrednost $N_1$, je verjetnost, da smo izbrali $N_1$ in da bo naslednje poissonovo naključno zajeto število $N_2$ večje enaka:
+\[
+P(N_2 > N_1) = P(N_1) \sum_{N_2=N_1+1}^{\inf} P(N_2) = P(N_1) \cdot (1 - F(N_1))
+\]
+Zaradi praktičnosti uvedemo notacijo:\\
+$P_+(M) = P(N_1 < N_2 < \cdots < N_{M-1} < N_M)$ - verjetnost za strogo naraščujoč niz dolžine M\\
+$P_-(M) = P(N_1 > N_2 > \cdots > N_{M-1} > N_M)$ - verjetnost za strogo padajoč niz dolžine M\\
+$P_=(M) = P(N_1 = N_2 = \cdots = N_{M-1} = N_M)$ - verjetnost za niz enakih vrednosti N dolžine M\\
+$P_+$ - verjetnost za verjetnost za strogo naraščujoč niz\\
+$P(M)$ - verjetnost za niz dolžine M\\
+$N_+(M) = N(N_1 < N_2 < \cdots < N_{M-1} < N_M)$ - število strogo naraščujočih nizov dolžine M\\
+$N_-, N_=, P_-,P_=$ - analogno\\
+
+Prejšen izraz posplošimo na vse možne $N_i$ in vse možne nize števil $N_1<N_2<\cdots<N_{M-1}<N_M$ pri dolžini niza M dobimo rahlo nepregledno formulo:
+\[
+P_+(M) = \sum_{N_1=0}^{\inf} \left( P(N_1) \sum_{N_2=N_1+1}^{\inf} \left( P(N_2) \cdots \sum_{N_{M-1}=N_{M-2}+1}^{\inf} \left( P(N_{M-1})(1 - F(N_{M-1}) \right)\right)\right)
+\]
+Za reševanje te enačbe se zdi primerno orodje rekurzivna funkcija:
+\lstinputlisting{../octave/zap.m}
+
+Možno pa je tudi reševanje z matriko kombinacij - zapišemo matriko vseh možnih zaporedij, kjer so vrstice možna zaporedja. Nato izračunamo verjetnosti za te elemente in jih zapišemo v matriko enakih dimenzij. Elemente te matrike zmnožimo po vrsticah, da dobimo verjetnost vsakega od možnih zaporedij in jih zapišemo v vektor. Elemente tega vektoja seštejemo in dobimo verjetnost, da bo dolžina strogo naraščujočega zaporedja enaka številu stolpcev naše originalne matrike. Primer kode:
+
+\begin{lstlisting}
+zaporedja = combntns(0:4,3) # dobimo matriko kombinacij, vrednosti od 0:4 na 3 mesta
+verjetnosti = poisspdf(poti,1) # verjetnosti za posamezne elemente
+verjetnosti_zaporedij = prod(verjetnosti',1)' # verjetnost posameznega zaporedja
+verjetnost = sum(verjetnosti_zaporedij) # skupna verjetnost zaporedij
+\end{lstlisting}
+
+$\newline$
+
+Uporabil sem oba pristopa in (pri $\bar{N}$ = 1) izračunal verjetnosti za različne dolžine strogo naraščujočih nizov. Dobljene rezultate sem normiral, tako da $\sum_{m=1}^{\inf} P_+(m) = 1$.
+
+Rezultat obeh pristopov je viden na grafu predvidene verjetnostne porazdelitve $P_+(M)$ (Slika \ref{plot2}):
+
+\begin{figure}[h]
+\begin{center}
+\includegraphics[width=14cm]{slike/plot2}
+\caption{Verjetnost dolžine niza $P_+(M)$ v odvisnosti od njegove dolžine $M$, $\bar{N}=1$}
+\label{plot2}
+\end{center}
+\end{figure}
+
+\section{Numerični račun}
+
+\subsection{"Run-up" test}
+
+Za preizkus generatorjev naključnih števil uporabimo "run-up" test: v danem vzorcu številu preštejemo striktno naraščujoče nize z dolžino M in jih primerno normaliziramo, da dobimo delež teh nizov $P'$.
+\[
+P_+' = \frac{N_+}{N_+ + N_- + N_=}
+\]
+\[
+P'(M) = \frac{N(M)}{ \sum_{m=1}^{\inf} N(m)}
+\]
+\[
+P_+'(M) = P'(+) \cdot P'(M) = \frac{N_+ N(M)}{(N_+ + N_- + N_=) \cdot \sum_{m=1}^{\inf}N(m)}
+\]
+
+Delež strogo naraščujočih nizov še normaliziramo, da je primerljiv z izračunano verjetnostjo: $\sum_{m=1}^{\inf} P_+'(m) = 1$.
+
+\subsection{Generatorji}
+
+Za analizo uporabimo sete števil dolžine $10^6$ iz različnih virov, porazdeljenih po naključni poissonovi porazdelitvi z $\bar{N}=1$. Večina generatorjev te porazdelitve uporablja algoritem opisan v \cite[str.~504]{devroye}, ki iz uniformne porazdelitve generira poissonovo.\\
+Uporabimo generatorje iz različnih okolij: numpy.random.poisson, Octave/Matlab - poissrnd, Octave/Matlab - rand + Devroye, R - rpois, PHP rand@Windows + Devroye.
+
+S spletne strani random.org je mogoče dobiti tudi prave (tako trdi avtor) naključne podatke, vendar v omejenih količinah - uporabili smo niz $10^3$ uniformno porazdeljenih števil iz intervala [0,1).
+
+Rezultate prikažemo na sliki \ref{plot5} in približane na sliki \ref{plot6}:
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=14cm]{slike/plot5}
+\caption{Normaliziran delež naraščujočih nizov ($P_+'(M)$) in verjetnost za dolžino naraščujočih nizov ($P_+(M)$) v odvisnosti od njihove dolžine $M$. $\bar{N}=1$}
+\label{plot5}
+\end{center}
+\end{figure}
+
+\newpage
+
+\section{Zaključek}
+Izkaže se da je računanje verjetnosti za daljše strogo naraščujoče nize v poissonovi porazdelitvi računsko zahtevna naloga, vendar imajo pri previdno izbranem $\bar{N}$ kratek rep, kar nalogo precej olajša.
+
+Po grafih sklepamo, da večina priljubljenih računskih paketov generira zelo dobre nize poissonovih naključnih števil, saj so razlike med deleži v generiranih nizih, deleži v nizu naključnih števil in pričakovanimi verjetnostmi dolžin velikostnega reda $10^3$.
+
+\begin{figure}[H]
+\begin{center}
+\includegraphics[width=13cm]{slike/plot6}
+\caption{Normaliziran delež naraščujočih nizov ($P_+'(M)$) in verjetnost za dolžino naraščujočih nizov ($P_+(M)$) v odvisnosti od njihove dolžine $M$. $\bar{N}=1$}
+\label{plot6}
+\end{center}
+\end{figure}
+
+\begin{thebibliography}{99}
+
+\bibitem{kodre} I. Kuščer in A. Kodre: Matematika v fiziki in tehniki, DMFA, Ljubljana, 1994
+\bibitem{matlabDoc} Dokumentacija programa Matlab - http://www.mathworks.com/help/techdoc/
+\bibitem{devroye} Luc Devroye: Non-uniform random variate generation, Springer-Verlag New York, 1986 (http://www.eirene.de/Devroye.pdf)
+
+% I. Priimek, Naslov knjige, Zalo?nik, MestoIzdaje, Letnica.
+% \bibitem{oznakaClanka} I. Priimek, Naslov ?lanka, Naslov revije Letnik (Leto) str.\ Od--Do.
+\end{thebibliography}
+
+
+% \subsection{Prvi podrazdelek prvega razdelka}
+
+% Tu napišete vsebino prvega podrazdelka prvega razdelka. \LaTeX je namenjen predvsem matematičnim besedilom. Vsaka matematična formula, tudi zgolj $x$, se pojavi med dvema \$ znakoma: \verb.$x$.. Seveda pa lahko napišemo tudi bolj zapletene izraze: $$\int_0^\infty \frac{1}{x^3}dx.$$
+
+
+% \begin{izrek}
+% \label{iz:prviIzrek}
+% Tu napišete besedilo izreka.
+% \end{izrek}
+% \begin{dokaz}
+% Tu napišete besedilo dokaza. Lahko je dolgo več vrstic, ali pa sem in tja % preide tudi v nov odstavek.
+
+%Nov odstavek se začne po prazni vrstici.
+%\end{dokaz}
+
+
+% Sledi še primer naštevanja z možnim sklicevanjem, npr. na Izrek \ref{iz:prviIzrek}:
+% \begin{enumerate}[label=(\roman{*}), ref=(\roman{*})]
+% \item \label{it:prva} Prva alineja je pred alinejo \ref{it:druga}.
+% \item \label{it:druga} Druga alineja sledi alineji \ref{it:prva}.
+% \end{enumerate}
+
+
+\end{document}
283 latex/mcode.sty
@@ -0,0 +1,283 @@
+%%
+%% This is file `mcode.sty'
+%%
+%% It is supposed to help you easily include MATLAB source code
+%% into LaTeX document, but have it nicely highlighted, using
+%% the great listings package.
+%%
+%% PLEASE NOTE that this package does nothing but save you from
+%% figuring out some configurations in setting up the LISTINGS
+%% package. ALL the work is done by that package! Thus, please
+%% refer your questions to the listings package documentation.
+%%
+%% Usage: You have three ways of including your MATLAB code. As
+%% environment, as inline object and directly from an external
+%% file.
+%%
+%% 1) Environment:
+%%
+%% \begin{lstlisting}
+%% YOUR CODE HERE
+%% \end{lstlisting}
+%%
+%%
+%% 2) Inline object:
+%%
+%% Bla bla \mcode{CODEFRAGMENT} bla bla.
+%%
+%%
+%% 3) Include external file (in environment form)
+%%
+%% \lstinputlisting{YOUR-FILE.m}
+%%
+%%
+%% For your convenience this package has the following options:
+%%
+%% - bw if you intend to print the document (highlighting done
+%% via text formatting (bold, italic) and shades of gray)
+%%
+%% - numbered if you want line numbers
+%%
+%% - autolinebreaks if you want the package to automatically
+%% wrap your code. This is buggy as it may well break
+%% break syntax and it doesn't work well with comments.
+%% You REALLY should wrap your code manually.
+%%
+%% - useliterate if you want some characters / relations in
+%% your code to be replace with something more readable.
+%% Example: ~= becomes $\neq$, >= becomes $\geq$, delta
+%% becomes $\delta$ and so on.
+%%
+%% - framed if you want a frame around the source code blocks
+%%
+%% - final if you have ``gloablly'' set the draft option, the
+%% listings package will not output the code at all. to
+%% force it to do so anyway, load this package with the
+%% final option (passes the ``final'' on to listings).
+%%
+%% For example, you may use \usepackage[numbered,framed]{mcode}
+%% in your document preamble.
+%%
+%% Note: Inside code blocks you can escape to LaTeX text mode
+%% using §...§. For ex. §text and some math: $x^2$§, which is
+%% especially useful in comments for putting nicely typeset
+%% equations etc. To get the same colour/style as in the rest
+%% of the comment use \mcommentfont, i.e. §\mcommentfont $x^2$§
+%%
+%% To change the font used, edit the first line in the "custo-
+%% mise below" section. And feel free to edit other things as
+%% well. Refer to the documentation of the listings package to
+%% see what else you could do. If an extra small font is re-
+%% quired, use {\fontfamily{pcr}\fontsize{3}{4.6}\selectfont}
+%% in the definition of \lstbasicfont.
+%%
+%% Author:
+%% Florian Knorn | florian@knorn.org | www.florian-knorn.com
+%%
+%% Version history:
+%% 2.3 -- More keywords (thanks Dominik Wild!)
+%% 2.2 -- Bugfix (thanks Willi Gerbig!)
+%% 2.1 -- Finally automatic detection between end and end
+%% 2.0 -- New options for line breaking and literate prog.
+%% 1.8 -- Fixed typo in documentation regarding §...§
+%% 1.7 -- Added MATLAB block comment syntax %{ ...... %}
+%% 1.6 -- Added some infos, dealing with keyword ``end''
+%% 1.5 -- Tweaked check to see wether textcomp is loaded
+%% 1.4 -- Fixed misconfig (mathescape now set to false)
+%% 1.3 -- Purely cosmetic (tabs replaced by spaces)
+%% 1.2 -- Added \lstset{showstringspaces=false}
+%% 1.1 -- Added \mcode command and [final] option
+%% 1.0 -- Release
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% D O N ' T T O U C H T H I S %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\def\fileversion{2.3}
+\def\filedate{2012/08/31}
+
+\typeout{-- Package: `mcode' \fileversion\space <\filedate> --}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{mcode}[\filedate\space\fileversion]
+
+% for bw-option
+\newif\ifbw
+\DeclareOption{bw}{\bwtrue}
+
+% numbered option
+\newif\ifnumbered
+\DeclareOption{numbered}{\numberedtrue}
+
+% final option
+\newif\iffinal
+\DeclareOption{final}{\finaltrue}
+
+% autolinebreaks option
+\newif\ifautolinebreaks
+\DeclareOption{autolinebreaks}{\autolinebreakstrue}
+
+% literate programming (replace certain characters/relations
+\newif\ifuseliterate
+\DeclareOption{useliterate}{\useliteratetrue}
+
+% framed option
+\newif\ifframed
+\DeclareOption{framed}{\framedtrue}
+
+\DeclareOption*{% default
+ \PackageWarning{mcode}{Unknown option `\CurrentOption' !}%
+}
+\ProcessOptions
+
+\ifbw\typeout{ - settings optimized for printing (bw formating)}
+\else\typeout{ - settings optimized for display (colour formating)}\fi
+\ifnumbered\typeout{ - line numbering enabled}\else\fi
+\ifuseliterate\typeout{ - literate programming (character replacements) enabled}\else\fi
+\ifautolinebreaks\typeout{ - automatic line breaking enabled (careful, buggy!)}\else\fi
+\ifframed\typeout{ - framed listings}\else\fi
+
+% This command allows you to typeset syntax highlighted Matlab
+% code ``inline''. The font size \small seems to look best...
+\newcommand{\mcode}[1]{\lstinline[basicstyle=\lstbasicfont\small]|#1|}
+
+% check if color command exists
+\ifx\color\undefined%
+ \RequirePackage{xcolor}%
+\fi
+
+% check if listings has been loaded
+\ifx\lstset\undefined%
+ \iffinal
+ \RequirePackage[final]{listings}
+ \else
+ \RequirePackage{listings}
+ \fi
+\fi
+
+% Check if textcomp has been loaded (this package is needed for
+% upright quotes '' (instead of typographic ones `´)...
+\ifx\textquotesingle\undefined%
+ \RequirePackage{textcomp}%
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% C U S T O M I S E B E L O W %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% ---------------------------------------------------------------------------------
+% default font
+\def\lstbasicfont{\fontfamily{pcr}\selectfont\footnotesize}
+
+% ---------------------------------------------------------------------------------
+% matlat languate definition
+\lstdefinelanguage{matlabfloz}{%
+ alsoletter={...},%
+ morekeywords={% % keywords
+ break,case,catch,continue,elseif,else,end,%
+ for,function,global,if,otherwise,persistent,%
+ return,switch,try,while,methods,properties,%
+ events,classdef,...},%
+ comment=[l]\%, % comments
+ morecomment=[l]..., % comments
+ morecomment=[s]{\%\{}{\%\}}, % block comments
+ morestring=[m]' % strings
+}[keywords,comments,strings]%
+
+% ---------------------------------------------------------------------------------
+% general definitions
+\lstset{%
+ basicstyle={\lstbasicfont}, % set font
+ showstringspaces=false, % do not emphasize spaces in strings
+ tabsize=4, % number of spaces of a TAB
+ mathescape=false,escapechar=§, % escape to latex with §...§
+ upquote=true, % upright quotes
+ aboveskip={1.5\baselineskip}, % a bit of space above listings
+ columns=fixed % nice spacing
+}
+
+% ---------------------------------------------------------------------------------
+% define colours and styles
+\ifbw % use font formating and gray 'colors'
+ \def\mcommentfont{\color[gray]{.75}\itshape} %comments light gray and italic
+ \lstset{language=matlabfloz, % use our version of highlighting
+ keywordstyle=\bfseries, % keywords in bold
+ commentstyle=\mcommentfont, % comments
+ stringstyle=\color[gray]{0.5} % strings darker gray
+ }
+\else% notbw => use colors : )
+ \def\mcommentfont{\color[rgb]{.133,.545,.133}} %comments in green
+ \lstset{language=matlabfloz, % use our version of highlighting
+ keywordstyle=\color[rgb]{0,0,1}, % keywords in blue
+ commentstyle=\mcommentfont, % comments
+ stringstyle=\color[rgb]{.627,.126,.941} % strings in purple
+ }
+\fi%bw
+
+% ---------------------------------------------------------------------------------
+% automatic line breaking --- warning, this is buggy and
+% doesn't break comments correctly!
+\ifautolinebreaks
+ \newsavebox{\lbreakdots}\sbox{\lbreakdots}{\lstbasicfont\mcommentfont...}
+ \lstset{breaklines=true,breakatwhitespace=true,prebreak=\usebox{\lbreakdots}}
+\fi
+
+% ---------------------------------------------------------------------------------
+% literate replacements
+% the following is for replacing some matlab relations like >= or ~=
+% by the corresponding LaTeX symbols, which are much easier to read ...
+\ifuseliterate
+ \lstset{%
+ literate=%
+ {~}{{$\neg$}}1 % \neg
+ {<=}{{\tiny$\leq$}}1 % \leq
+ {>=}{{\tiny$\geq$}}1 % \geq
+ {~=}{{\tiny$\neq$}}1 % \neq
+ {delta}{{\tiny$\Delta$}}1 % \Delta
+ {(end)}{\lstbasicfont (end)}{5} % black ``end'' when indexing last vector element
+ {({ }end)}{\lstbasicfont ({ }end)}{6}
+ {(end{ })}{\lstbasicfont (end{ })}{6}
+ {({ }end{ })}{\lstbasicfont ({ }end{ })}{7}
+ {:end}{\lstbasicfont :end}{4}
+ {:{ }end}{\lstbasicfont :{ }end}{5}
+ {end:}{\lstbasicfont end:}{4}
+ {end{ }:}{\lstbasicfont end{ }:}{5}
+ {,end}{\lstbasicfont ,end}{4}
+ {,{ }end}{\lstbasicfont ,{ }end}{5}
+ }
+\else
+ \lstset{%
+ literate=%
+ {(end)}{\lstbasicfont (end)}{5} % black ``end'' when indexing last vector element
+ {({ }end)}{\lstbasicfont ({ }end)}{6}
+ {(end{ })}{\lstbasicfont (end{ })}{6}
+ {({ }end{ })}{\lstbasicfont ({ }end{ })}{7}
+ {:end}{\lstbasicfont :end}{4}
+ {:{ }end}{\lstbasicfont :{ }end}{5}
+ {end:}{\lstbasicfont end:}{4}
+ {end{ }:}{\lstbasicfont end{ }:}{5}
+ {,end}{\lstbasicfont ,end}{4}
+ {,{ }end}{\lstbasicfont ,{ }end}{5}
+ }
+\fi%literates
+
+% ---------------------------------------------------------------------------------
+% line numbering
+\ifnumbered% numbered option
+ \lstset{%
+ numbersep=3mm, numbers=left, numberstyle=\tiny, % number style
+ }
+\fi
+
+\ifframed% framed option
+ \lstset{%
+ frame=single, % frame
+ }
+ \ifnumbered%
+ \lstset{%
+ framexleftmargin=6mm, xleftmargin=6mm % tweak margins
+ }
+ \fi
+\fi
+
+\endinput
+%% End of file `mcode.sty'.
BIN  latex/slike/plot1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  latex/slike/plot2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  latex/slike/plot5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  latex/slike/plot6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  mafi1.pdf
Binary file not shown
29 octave/arunup.m
@@ -0,0 +1,29 @@
+%%%%%%%%%%%%%%%%%%%%
+% arunup
+% Izracuna verjetnosti da generator poissonove nakljucne
+% porazdelitve pri danem lambda vrne narascujoc niz stevil
+% dolzine M, pri tem da je poisspdf(N,lambda) prvo stevilo.
+% Verjetnosti podnizov se izracunajo z rekurzivno funkcijo
+% podzap(N,M,lambda). Vrne vektor vrjetnosti P(M).
+%
+% N = zacetna tocka niza
+% M = dolzina narascujocega niza
+
+function arunup()
+ lambda = 1;
+ M = [2:11];
+ Nmin = 0;
+ inf = 10;
+ P1=[];
+ P2=[];
+
+ for i=M
+ P1 = [P1, zap(Nmin,inf,i,lambda)];
+ P2 = [P2, sum(prod(poisspdf(combntns(Nmin:inf,i),lambda),2))];
+ end
+
+ P1 = P1'/sum(P1);
+ P2 = P2'/sum(P2);
+ save('-ascii', 'podatki/arunup.txt', 'P1')
+ save('-ascii', 'podatki/arunupc.txt', 'P2')
+end
32 octave/demo.m
@@ -0,0 +1,32 @@
+%%%%%%%%%%%%%%%%%%%%
+% demo
+
+clear ; close all; clc
+
+lambda = 1;
+M = [2:11];
+Nmin = 0;
+Nmax = 10;
+
+fprintf('Demo. Pritisni enter.\n');
+pause;
+
+poti = combntns(0:4,3)
+
+fprintf('Mozna zaporedja. Pritisni enter.\n');
+pause;
+
+verjetnosti = poisspdf(poti,1)
+
+fprintf('Verjetnosti posameznih korakov. Pritisni enter.\n');
+pause;
+
+verjetnosti_poti = prod(verjetnosti',1)'
+
+fprintf('Verjetnosti poti. Pritisni enter.\n');
+pause;
+
+verjetnost = sum(verjetnosti_poti)
+
+fprintf('Verjetnost dolzine zaporedja M. Pritisni enter.\n');
+pause;
16 octave/genpoiss.m
@@ -0,0 +1,16 @@
+%%%%%%%%%%%%%%%%%%%%
+% genpoiss
+% Generira nakljucna stevila porazdeljena po
+% poissonovi porazdelitvi in jih shrani v datoteko.
+% Koda: Standardna Octave
+%
+
+function genpoiss
+
+ lambda = 1;
+ N=1000000;
+
+ D = poissrnd(lambda,N,1);
+ save('-ascii', 'podatki/octavePoiss.txt', 'D')
+
+end
12 octave/genpoiss.py
@@ -0,0 +1,12 @@
+################################
+# genpoiss.py
+# Generira nakljucna stevila porazdeljena po
+# poissonovi porazdelitvi in jih shrani v datoteko.
+
+import numpy
+
+lambd = 1;
+N=1000000;
+
+D = numpy.random.poisson(lambd,N)
+numpy.savetxt('numpyPoiss.txt', D, fmt='%d')
64 octave/nrunup2.m
@@ -0,0 +1,64 @@
+function Y = nrunup2 (D)
+plus = 0;
+minus = 0;
+equal = 0;
+P = zeros(10,1);
+M = zeros(10,1);
+E = zeros(25,1);
+
+for i = [1:length(D)-1]
+
+ if D(i) < D(i+1)
+ if minus > 0
+ M(minus) = M(minus) + 1;
+ end
+ if equal > 0
+ E(equal) = E(equal) + 1;
+ end
+ plus = plus + 1;
+ minus = 0;
+ equal = 0;
+ end
+
+ if D(i) > D(i+1)
+ if plus > 0
+ P(plus) = P(plus) + 1;
+ end
+ if equal > 0
+ E(equal) = E(equal) + 1;
+ end
+ plus = 0;
+ minus = minus + 1;
+ equal = 0;
+ end
+
+ if D(i) == D(i+1)
+ if plus > 0
+ P(plus) = P(plus) + 1;
+ end
+ if minus > 0
+ M(minus) = M(minus) + 1;
+ end
+ plus = 0;
+ minus = 0;
+ equal = equal + 1;
+ end
+end
+
+ if plus > 0
+ P(plus) = P(plus) + 1;
+ end
+ if minus > 0
+ M(minus) = M(minus) + 1;
+ end
+ if equal > 0
+ E(equal) = E(equal) + 1;
+ end
+PP = P ./ (P + M + E(1:10,:) );
+PM = P / (sum(P + M) + sum(E));
+Y = PP .* PM;
+Y(6:end,end) = 0; % popravek zaradi NaN pri rand.org
+Y = Y ./ sum(Y)
+%Y = P / (sum(P + M) + sum(E))
+
+end
22 octave/nrunups2.m
@@ -0,0 +1,22 @@
+function nrunups2 ()
+D1 = load('-ascii','podatki/octavePoiss.txt');
+Y1 = nrunup2 (D1);
+
+D2 = load('-ascii','podatki/numpyPoiss.txt');
+Y2 = nrunup2 (D2);
+
+D3 = load('-ascii','podatki/octaveCustomPoiss.txt');
+Y3 = nrunup2 (D3);
+
+D4 = load('-ascii','podatki/phpCustomPoiss.txt');
+Y4 = nrunup2 (D4);
+
+D5 = load('-ascii','podatki/randPoissR.txt');
+Y5 = nrunup2 (D5);
+
+D6 = load('-ascii','podatki/octaveCustomPoissTru.txt');
+Y6 = nrunup2 (D6);
+
+Y = [Y1,Y2,Y3,Y5,Y4,Y6]
+save('-ascii', 'podatki/nrunups2.txt', 'Y')
+end
BIN  octave/octave-core
Binary file not shown
16 octave/plot1.m
@@ -0,0 +1,16 @@
+% Izriše poissonove porazdelitve z lambda = 1,5,10
+
+function plot1 ()
+l=20;
+x=[0:1:l];
+bar(x,[poisspdf(x,1);poisspdf(x,5);poisspdf(x,10)]',2);
+%plot(x,poisspdf(x,1),x,poisspdf(x,5),x,poisspdf(x,20));
+xlabel('N','FontSize',14);
+ylabel('P(N)','FontSize',14);
+
+set (gca, 'xlim', [-1, l]);
+set (gca,'XTick',[0:1:l]);
+legend('<N>= 1','<N> = 5','<N> = 10','location','northeast');
+
+print -dpng plot1.png
+end
11 octave/plot2.m
@@ -0,0 +1,11 @@
+% analiticna porazdelitev
+YA = [load('-ascii','podatki/arunup.txt')];
+YAc = [load('-ascii','podatki/arunupc.txt')];
+
+bar([1:10],[YA,YAc])
+ylabel('P(M)','FontSize',14);
+xlabel('M','FontSize',14);
+set (gca(), 'xlim', [0.5, 6.5]);
+title('<N> = 1','FontSize',14);
+
+print -dpng plot2.png
25 octave/ploto.m
@@ -0,0 +1,25 @@
+% analiticna porazdelitev
+% YA = [load('-ascii','podatki/arunup.txt')];
+YAc = [load('-ascii','podatki/arunupc.txt')];
+
+% numericno pridobljene porazdelitve
+%YN = load('-ascii','podatki/nrunups.txt');
+YN = load('-ascii','podatki/nrunups2.txt');
+
+%colormap(gray);
+
+bar([1:10],[YAc,YN])
+ylabel('P(M),P´(M)','FontSize',14);
+xlabel('M','FontSize',14);
+set (gca(), 'xlim', [0.5, 6.5]);
+legend('(1) Predvidena porazdelitev', ...
+'(2) NumPy - random.poisson',...
+'(3) Octave/Matlab - poissrnd',...
+'(4) Octave/Matlab - rand + Devroye[3]', ...
+'(5) R - rpois', ...
+'(6) PHP rand@Windows + Devroye[3]', ...
+'(7) Random.org + Devroye[3] (N=10^3)',...
+'location','northeast');
+title('<N> = 1','FontSize',14);
+
+print -dpng plot5.png
35 octave/ploto2.m
@@ -0,0 +1,35 @@
+Y = [load('-ascii','podatki/arunupc.txt'),load('-ascii','podatki/nrunups2.txt')];
+
+subplot(2,2,1)
+bar([1:10],Y);
+ylabel('P(M),P´(M)','FontSize',11);
+xlabel('M','FontSize',11);
+set (gca(), 'xlim', [0.5, 1.5]);
+ylim([min(Y(1,:))-0.001,max(Y(1,:))+0.001]);
+title('M = 1','FontSize',11);
+
+subplot(2,2,2)
+bar([1:10],Y);
+ylabel('P(M),P´(M)','FontSize',11);
+xlabel('M','FontSize',11);
+set (gca(), 'xlim', [1.5, 2.5]);
+ylim([min(Y(2,:))-0.001,max(Y(2,:))+0.001]);
+title('M = 2','FontSize',11);
+
+subplot(2,2,3)
+bar([1:10],Y);
+ylabel('P(M),P´(M)','FontSize',11);
+xlabel('M','FontSize',11);
+set (gca(), 'xlim', [2.5, 3.5]);
+ylim([0,max(Y(3,:))+0.001]);
+title('M = 3','FontSize',11);
+
+subplot(2,2,4)
+bar([1:10],Y);
+ylabel('P(M),P´(M)','FontSize',11);
+xlabel('M','FontSize',11);
+set (gca(), 'xlim', [3.5, 4.5]);
+ylim([0,max(Y(4,:))+0.00001]);
+title('M = 4','FontSize',11);
+
+print -dpng plot6.png
10 octave/podatki/arunup.txt
@@ -0,0 +1,10 @@
+ 8.7338932e-001
+ 1.2063751e-001
+ 5.8936315e-003
+ 7.9309420e-005
+ 2.2649790e-007
+ 1.1094000e-010
+ 7.8727408e-015
+ 7.0382328e-020
+ 7.0253615e-026
+ 7.0349852e-033
10 octave/podatki/arunupc.txt
@@ -0,0 +1,10 @@
+ 8.7338932e-001
+ 1.2063751e-001
+ 5.8936305e-003
+ 7.9309363e-005
+ 2.2649711e-007
+ 1.1093772e-010
+ 7.8716264e-015
+ 7.0303238e-020
+ 6.9547227e-026
+ 6.3361912e-033
10 octave/podatki/nrunups2.txt
@@ -0,0 +1,10 @@
+ 8.7373326e-001 8.7308779e-001 8.7368221e-001 8.7305383e-001 8.7137755e-001 8.8672197e-001
+ 1.2400852e-001 1.2463618e-001 1.2396654e-001 1.2473900e-001 1.2659109e-001 1.1279717e-001
+ 2.2562188e-003 2.2751321e-003 2.3493279e-003 2.2050141e-003 2.0307203e-003 4.8085837e-004
+ 1.9947899e-006 9.0126493e-007 1.9220745e-006 2.1466649e-006 6.3836018e-007 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
10 octave/podatki/nrunups3.txt
@@ -0,0 +1,10 @@
+ 1.2524422e-001 1.2515851e-001 1.2506806e-001 1.2423915e-001 1.2486758e-001 1.3730751e-001
+ 1.7775849e-002 1.7866793e-002 1.7745875e-002 1.8049088e-002 1.7840661e-002 1.7466465e-002
+ 3.2341491e-004 3.2614377e-004 3.3630751e-004 2.8953577e-004 3.1536975e-004 7.4460164e-005
+ 2.8594070e-007 1.2919775e-007 2.7514596e-007 9.1016035e-008 3.0702441e-007 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 NaN
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 NaN
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 NaN
+ 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 0.0000000e+000 NaN
1,000,000 octave/podatki/numpyPoiss.txt
1,000,000 additions, 0 deletions not shown
1,000,000 octave/podatki/octaveCustomPoiss.txt
1,000,000 additions, 0 deletions not shown
1,000 octave/podatki/octaveCustomPoissTru.txt
@@ -0,0 +1,1000 @@
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 4.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 5.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 4.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 4.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 6.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 4.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 4.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 4.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 4.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 4.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 4.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 4.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 4.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 4.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 4.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 3.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 3.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 0.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 0.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
+ 2.00000000e+000
+ 1.00000000e+000
1,000,000 octave/podatki/octavePoiss.txt
1,000,000 additions, 0 deletions not shown
100,000 octave/podatki/phpCustomPoiss.txt
100,000 additions, 0 deletions not shown
1,000,001 octave/podatki/phpRand.txt
1,000,001 additions, 0 deletions not shown
1,000,000 octave/podatki/randPoissR.txt
1,000,000 additions, 0 deletions not shown
10,000 octave/podatki/trunrnd.txt
10,000 additions, 0 deletions not shown
9 octave/rand2.m
@@ -0,0 +1,9 @@
+%%%%%%%%%%%%%%%%%%%%
+% rand2
+% Prebere nakljucna stevila porazdeljena po
+% neki porazdelitvi.
+
+function r = rand2(l,a)
+ D = load('-ascii','podatki/phpRand.txt');
+ r = D(l*(a):l*(a+1)-1);
+end
41 octave/urnd2poissrnd.m
@@ -0,0 +1,41 @@
+%%%%%%%%%%%%%%%%%%%%
+% urnd2poissrnd
+% Generira nakljucna stevila porazdeljena po
+% poissonovi porazdelitvi in jih shrani v datoteko.
+% Koda: Iz enakomerne porazdelitve poissonova
+% rand2(N,a) da nakljucna stevila
+function urnd2poissrnd()
+
+lambda = 1;
+l=100000;
+r = zeros(l,1);
+p = r;
+j = (1:l)';
+a=0;
+
+while ~isempty(j)
+ a = a + 1
+ p = p - log(rand2(length(j),a));
+ t = (p < lambda);
+ j = j(t);
+ p = p(t);
+ r(j) = r(j) + 1;
+end
+
+save('-ascii', 'podatki/phpCustomPoiss.txt', 'r');
+
+l=1000000;
+r = zeros(l,1);
+p = r;
+j = (1:l)';
+
+while ~isempty(j)
+ p = p - log(rand(length(j),1));
+ t = (p < lambda);
+ j = j(t);
+ p = p(t);
+ r(j) = r(j) + 1;
+end
+
+save('-ascii', 'podatki/octaveCustomPoiss.txt', 'r');
+end
22 octave/zap.m
@@ -0,0 +1,22 @@
+%%%%%%%%%%%%%%%%%%%%
+% zap
+% Rekurzivno izracuna verjetnost da generator
+% poissonove nakljucne porazdelitve pri lambda
+% vrne strogo narascajoc niz stevil dolzine M.
+%
+% N = zacetna tocka podniza
+% M = dolzina narascujocega niza
+
+function P = zap(Nmin,inf,M,lambda)
+
+ if M == 1
+ P = 1 - poisscdf(Nmin-1,lambda);
+
+ else
+ P = 0;
+ for i=Nmin:inf,
+ P = P + poisspdf(i,lambda) * zap(i+1,inf,M-1,lambda);
+ end
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.