commit eee7dc3aa251a41e11fb589c1d49427bf44cfb6b
parent 7206e5adb587d7ca582688ba29805ccbdb5b4512
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 5 May 2022 12:45:11 +0200
randcounts.1: finish first version
Diffstat:
M | randcounts.1 | | | 59 | ++++++++++------------------------------------------------- |
1 file changed, 10 insertions(+), 49 deletions(-)
diff --git a/randcounts.1 b/randcounts.1
@@ -25,6 +25,8 @@ Invokations of
.Nm
within the same microsecond will produce the same result.
.Pp
+Output consists of the number of points per bin, in tab-separated format.
+.Pp
The options are as follows:
.It Fl h
Show usage information.
@@ -36,63 +38,22 @@ Seed the pseudo-random number generator with this value, which is used
to generate reproducable binning.
.El
.Sh EXAMPLES
-Place 10 points in 4 bins with equal probability (25%). Due to the randomness, your output may differ:
-.Pp
-.Dl $ randcounts -n 10 0.25 0.25 0.25 0.25
-.Pp
-.Dl $ range -n 4
-.Dl 0
-.Dl 0.33333
-.Dl 0.66667
-.Dl 1
-.Pp
-Same as the previous example, but with full
-.Vt double
-precision on a 64-bit system:
-.Pp
-.Dl $ range -n 4 -f '%.17g\en' 0 1
-.Dl 0
-.Dl 0.33333333333333331
-.Dl 0.66666666666666663
-.Dl 1
-.Pp
-Generate four numbers in the range ]0;1[:
-.Pp
-.Dl $ range -b -e -n 4 0 1
-.Dl 0.2
-.Dl 0.4
-.Dl 0.6
-.Dl 0.8
-.Pp
-Print ten numbers in the interval [1;10] with spaces between values:
-.Pp
-.Dl $ range -f '%g ' 1 10
-.Dl 1 2 3 4 5 6 7 8 9 10
-.Pp
-Repeat and modify a string three times:
-.Pp
-.Dl $ range -n 3 -f 'The best number is %.0g\en' 1 3
-.Dl The best number is 1
-.Dl The best number is 2
-.Dl The best number is 3
+Put one point in 4 bins with equal probability (25%).
+Due to the randomness, your output may differ:
.Pp
-Generate three numbers evenly distributed in logspace from 10^0 to 10^2:
+.Dl $ randcounts 0.25 0.25 0.25 0.25
.Pp
-.Dl $ range -l -n 3 0 2
-.Dl 1
-.Dl 10
-.Dl 100
+.Dl 0 1 0 0
.Pp
-Generate three numbers in the range [-2;-1]:
+Put 100 point in two bins, with 75% and 25% probability, respectively:
.Pp
-.Dl $ range -n 3 -- -2 -1
-.Dl -2
-.Dl -1.5
-.Dl -1
+.Dl $ randcounts -n 100 0.75 0.25
+.Dl 78 22
.Sh SEE ALSO
.Xr max 1 ,
.Xr mean 1 ,
.Xr min 1 ,
+.Xr range 1 ,
.Xr rangetest 1 ,
.Xr sum 1
.Sh AUTHORS