Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
ClearAll[Modifier, CreateRandomNumber]
|
||||
Modifier[x_] := If[x < 0.5, 2 (0.5 - x), 2 (x - 0.5)]
|
||||
CreateRandomNumber[] := Module[{r1, r2, done = True},
|
||||
While[done,
|
||||
r1 = RandomReal[];
|
||||
r2 = RandomReal[];
|
||||
If[r2 < Modifier[r1],
|
||||
Return[r1];
|
||||
done = False
|
||||
]
|
||||
]
|
||||
]
|
||||
numbers = Table[CreateRandomNumber[], 100000];
|
||||
{bins, counts} = HistogramList[numbers, {0, 1, 0.05}, "PDF"];
|
||||
Grid[MapThread[{#1, " - ", StringJoin@ConstantArray["X", Round[20 #2]]} &, {Partition[bins, 2, 1], counts}], Alignment -> Left]
|
||||
Loading…
Add table
Add a link
Reference in a new issue