Posts

Showing posts from November, 2020

Rare intersecting with rare is pretty much empty

Image
Having good intuition about rare events is actually pretty difficult. Thinking in terms of the plots below helps me with the subject. This is all in this Jupyter notebook . (Note: formatting below is iffy as original is in Jupyter notebook) #!/usr/bin/env python3 % matplotlib inline import numpy as np import matplotlib.pyplot as plt An illustration of how some things are rare, and others common Our "test" population is a thousand In [2]: n =1000 Rare numbers are numbers that are special one way of another. Here rarity means "uniformly randomly generated number between 0 and 1 near to one". We can find them by raising the numbers to a high power (e.g. 100). If they are not close enough to one, they get "crushed" to 0. In [3]: def mk_rare ():      return np . power(np . random . uniform( 0.0 , 1.0 , n), 100 ) rare = mk_rare()   The plot of the rare numbers: In [4]: plt . plot(rare) plt . show() The common numbers are all random numbers that are no...