line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CLI::Coin::Toss; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
47497
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
55
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
CLI::Coin::Toss - Several random number generators by CLI (Command Line Interface) are provided. |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Version 0.35 |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=cut |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = '0.35'; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
cointoss -- Bernoulli/Binomial |
24
|
|
|
|
|
|
|
saikoro -- uniform distributions |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
boxmuller -- generate normal distribution (so-called Gauss distribution) |
27
|
|
|
|
|
|
|
cauchydist -- Cauchy distribution (Student's t-distribution with d.f. = 1 ) |
28
|
|
|
|
|
|
|
randexp -- Exponential distributions and also Laplace distributions |
29
|
|
|
|
|
|
|
poisson -- Poisson distriution |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
matrixpack -- pack elements into matrix-like shape. |
32
|
|
|
|
|
|
|
quantiles -- calculates quantiles |
33
|
|
|
|
|
|
|
entropy -- calculates entropy |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
The guide to use these commands can be found by "--help", such as 'cointoss --help'. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 AUTHOR |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
"Toshiyuki Shimono", C<< >> |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SUPPORT |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
perldoc CLI::Coin::Toss |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
The next version may contain the random variable generator of Student's t distribution |
49
|
|
|
|
|
|
|
with the degree of freedom being 2. It is because the following theorem is curious. |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
For real numbers v1 and v2 given, and random variable v1 and v2 both come |
52
|
|
|
|
|
|
|
from the t-distribution with the degree of freedom = 2, |
53
|
|
|
|
|
|
|
Prob ( | v1*r1 | > |v2*r2| ) : Prob ( | v1*r1| < |v2*r2| ) = v1 : v2 holds. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Copyright 2018 "Toshiyuki Shimono". |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify |
61
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
62
|
|
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or |
63
|
|
|
|
|
|
|
(at your option) any later version. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, |
66
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
67
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
68
|
|
|
|
|
|
|
GNU General Public License for more details. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
71
|
|
|
|
|
|
|
along with this program. If not, see L. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; # End of CLI::Coin::Toss |