Sunday, November 06, 2022

[kjkwejol] simulating a Geiger counter

one can sample an exponential distribution by sampling -log(r), where r is a uniform random number between 0 and 1, avoiding 0.  previously similar: Zipf.

below are 100 samples.  these samples could be interpreted as the time interval between clicks of a Geiger counter with a radioactive source whose radioactivity is not changing appreciably over the course of sampling, i.e., it's not running out of radioactive nuclei.

perhaps this is useful for rhythms for randomly generated music.  do exponentially distributed intervals of time sound natural to the human ear?

  1. 0.329822540170288
  2. 2.01570117173415
  3. 0.830904930508312
  4. 0.259590046333096
  5. 0.210671751828385
  6. 0.981880069850274
  7. 0.806434405652764
  8. 1.15050564549307
  9. 0.373349932361676
  10. 4.23392451058767
  11. 0.172415567301495
  12. 0.653248201207598
  13. 0.96666339503192
  14. 0.13534487233904
  15. 0.289088688952651
  16. 0.531836620254011
  17. 2.32181489702822
  18. 0.384826959312606
  19. 1.63305210397679
  20. 0.886589969323164
  21. 0.105894896633003
  22. 0.748437035755276
  23. 1.37988086336003
  24. 0.306905320284676
  25. 0.592224886912056
  26. 0.168501440777515
  27. 3.32794912019537
  28. 0.0465486432724408
  29. 0.586012697230455
  30. 0.777131966567865
  31. 0.665789558925646
  32. 1.98969777447592
  33. 0.942378843476661
  34. 3.1394392472996
  35. 0.610809962724662
  36. 2.35923395358543
  37. 1.05532024392878
  38. 1.05108093027308
  39. 0.136479496280007
  40. 3.3094550400202
  41. 1.36981816389664
  42. 0.00673437989245406
  43. 1.29292125772523
  44. 1.23548146817635
  45. 2.21806669289339
  46. 1.51344618543233
  47. 0.263745821722615
  48. 1.11239526317473
  49. 1.25975294252588
  50. 0.578795550843225
  51. 2.16620179735083
  52. 1.36928119780205
  53. 1.59908602306717
  54. 1.1078295748761
  55. 0.37561225295492
  56. 0.572176602060967
  57. 0.0243590936172701
  58. 1.20920788375038
  59. 1.55734595506995
  60. 1.20052457907533
  61. 2.26781380265669
  62. 0.267104356255194
  63. 1.74182608161748
  64. 1.43040706052358
  65. 0.159788594534832
  66. 1.33818083679037
  67. 1.10031066700435
  68. 0.0290666906855637
  69. 1.56324690397278
  70. 2.32822866561526
  71. 1.38569406218654
  72. 1.345596044791
  73. 0.798852463928619
  74. 0.200689616173405
  75. 0.922370348252729
  76. 0.201207579893621
  77. 1.58083072548718
  78. 2.59288826325467
  79. 0.630164645071796
  80. 0.991009771558706
  81. 5.11062256536374
  82. 0.774943061148945
  83. 0.144718079806899
  84. 3.39733531614352
  85. 1.40354727764776
  86. 1.70284248658825
  87. 0.504035869192759
  88. 1.44673965697313
  89. 0.813505112238803
  90. 1.43741073402435
  91. 1.08158037197166
  92. 0.103234581551111
  93. 8.73063234335683
  94. 0.708871337206872
  95. 0.882810598009307
  96. 0.195284601504594
  97. 0.10173084752825
  98. 1.45148285731879
  99. 0.0238642031706031
  100. 0.124148652311142

below are same 100 samples sorted, also giving the difference between consecutive sorted samples.  this models starting with exactly 100 radioactive nuclei which all eventually decay.  the time interval between clicks generally gets larger over time, but not monotonically.

  1. 0.00673437989245406 +0.017129823278149
  2. 0.0238642031706031 +0.000494890446667073
  3. 0.0243590936172701 +0.0047075970682936
  4. 0.0290666906855637 +0.017481952586877
  5. 0.0465486432724408 +0.055182204255809
  6. 0.10173084752825 +0.00150373402286151
  7. 0.103234581551111 +0.00266031508189132
  8. 0.105894896633003 +0.0182537556781393
  9. 0.124148652311142 +0.0111962200278977
  10. 0.13534487233904 +0.00113462394096783
  11. 0.136479496280007 +0.0082385835268915
  12. 0.144718079806899 +0.0150705147279326
  13. 0.159788594534832 +0.00871284624268331
  14. 0.168501440777515 +0.00391412652398004
  15. 0.172415567301495 +0.0228690342030988
  16. 0.195284601504594 +0.00540501466881174
  17. 0.200689616173405 +0.000517963720216008
  18. 0.201207579893621 +0.00946417193476323
  19. 0.210671751828385 +0.0489182945047117
  20. 0.259590046333096 +0.00415577538951839
  21. 0.263745821722615 +0.00335853453257873
  22. 0.267104356255194 +0.0219843326974573
  23. 0.289088688952651 +0.0178166313320254
  24. 0.306905320284676 +0.0229172198856117
  25. 0.329822540170288 +0.0435273921913881
  26. 0.373349932361676 +0.00226232059324394
  27. 0.37561225295492 +0.00921470635768601
  28. 0.384826959312606 +0.119208909880153
  29. 0.504035869192759 +0.0278007510612511
  30. 0.531836620254011 +0.0403399818069564
  31. 0.572176602060967 +0.00661894878225777
  32. 0.578795550843225 +0.00721714638723048
  33. 0.586012697230455 +0.00621218968160075
  34. 0.592224886912056 +0.0185850758126059
  35. 0.610809962724662 +0.0193546823471338
  36. 0.630164645071796 +0.0230835561358026
  37. 0.653248201207598 +0.0125413577180475
  38. 0.665789558925646 +0.0430817782812257
  39. 0.708871337206872 +0.0395656985484044
  40. 0.748437035755276 +0.0265060253936694
  41. 0.774943061148945 +0.00218890541891947
  42. 0.777131966567865 +0.0217204973607538
  43. 0.798852463928619 +0.0075819417241455
  44. 0.806434405652764 +0.00707070658603859
  45. 0.813505112238803 +0.0173998182695091
  46. 0.830904930508312 +0.0519056675009956
  47. 0.882810598009307 +0.00377937131385653
  48. 0.886589969323164 +0.0357803789295648
  49. 0.922370348252729 +0.0200084952239324
  50. 0.942378843476661 +0.0242845515552587
  51. 0.96666339503192 +0.0152166748183544
  52. 0.981880069850274 +0.00912970170843175
  53. 0.991009771558706 +0.0600711587143735
  54. 1.05108093027308 +0.00423931365569774
  55. 1.05532024392878 +0.0262601280428876
  56. 1.08158037197166 +0.0187302950326871
  57. 1.10031066700435 +0.00751890787174547
  58. 1.1078295748761 +0.00456568829863735
  59. 1.11239526317473 +0.038110382318332
  60. 1.15050564549307 +0.0500189335822674
  61. 1.20052457907533 +0.00868330467504475
  62. 1.20920788375038 +0.0262735844259698
  63. 1.23548146817635 +0.024271474349532
  64. 1.25975294252588 +0.0331683151993496
  65. 1.29292125772523 +0.0452595790651393
  66. 1.33818083679037 +0.00741520800063311
  67. 1.345596044791 +0.0236851530110431
  68. 1.36928119780205 +0.000536966094591973
  69. 1.36981816389664 +0.0100626994633939
  70. 1.37988086336003 +0.00581319882650755
  71. 1.38569406218654 +0.0178532154612179
  72. 1.40354727764776 +0.0268597828758255
  73. 1.43040706052358 +0.00700367350077191
  74. 1.43741073402435 +0.00932892294877297
  75. 1.44673965697313 +0.00474320034566444
  76. 1.45148285731879 +0.0619633281135412
  77. 1.51344618543233 +0.0438997696376127
  78. 1.55734595506995 +0.00590094890283654
  79. 1.56324690397278 +0.0175838215144004
  80. 1.58083072548718 +0.018255297579985
  81. 1.59908602306717 +0.0339660809096198
  82. 1.63305210397679 +0.069790382611461
  83. 1.70284248658825 +0.0389835950292317
  84. 1.74182608161748 +0.247871692858435
  85. 1.98969777447592 +0.0260033972582321
  86. 2.01570117173415 +0.150500625616687
  87. 2.16620179735083 +0.0518648955425562
  88. 2.21806669289339 +0.0497471097633002
  89. 2.26781380265669 +0.054001094371531
  90. 2.32181489702822 +0.00641376858703468
  91. 2.32822866561526 +0.0310052879701721
  92. 2.35923395358543 +0.233654309669237
  93. 2.59288826325467 +0.546550984044933
  94. 3.1394392472996 +0.170015792720605
  95. 3.3094550400202 +0.0184940801751643
  96. 3.32794912019537 +0.0693861959481543
  97. 3.39733531614352 +0.836589194444144
  98. 4.23392451058767 +0.876698054776075
  99. 5.11062256536374 +3.62000977799309
  100. 8.73063234335683

popcorn.

wikipedia article, which cites the book by Devroye (mentioned previously) for efficiently generating a sorted list of samples.

No comments :