Skip to content

Instantly share code, notes, and snippets.

@JamesTryand
Created January 6, 2017 06:38
Show Gist options
  • Select an option

  • Save JamesTryand/325b99b23b20903b2d3251caaeeb9024 to your computer and use it in GitHub Desktop.

Select an option

Save JamesTryand/325b99b23b20903b2d3251caaeeb9024 to your computer and use it in GitHub Desktop.
.net random number generator test
$a = [array]::CreateInstance([int],101)
1..1000000 | %{ get-random -max 100 -min 0 } | %{ $a[$_] = $a[$_] + 1 }
0..100| select @{n='Value';e={$_}}, @{n='Count';e={$a[$_]}} | sort count
gave the following results
Value Count
----- -----
100 0
32 9669
55 9748
70 9761
61 9783
49 9815
82 9819
96 9829
62 9853
18 9881
43 9882
34 9888
64 9889
68 9893
38 9897
57 9902
46 9906
86 9918
24 9920
52 9920
59 9921
28 9922
47 9926
17 9933
14 9934
39 9936
60 9937
66 9940
1 9945
95 9949
0 9952
50 9952
65 9953
29 9956
67 9956
56 9967
12 9973
37 9975
48 9976
13 9980
63 9983
74 9984
51 9989
98 9990
42 9992
25 9993
5 9994
93 9999
23 10001
84 10002
76 10006
44 10008
92 10010
3 10011
69 10014
41 10014
21 10017
26 10017
11 10020
54 10021
73 10021
20 10023
97 10024
79 10034
6 10036
83 10038
4 10044
80 10045
78 10048
40 10052
71 10053
27 10060
19 10061
88 10061
90 10063
77 10069
94 10069
87 10076
72 10076
7 10079
99 10084
91 10086
2 10089
45 10093
31 10100
58 10103
8 10105
33 10120
36 10122
85 10127
30 10128
35 10130
75 10132
89 10132
22 10137
81 10146
16 10151
15 10154
10 10184
9 10199
53 10225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment