Whack it with an X squared!
- 1 minutes read - 196 wordsDavid and I were working on our Math381 model, and I was getting frustrated because the data we collected and the results from the simulation were not lining up properly, which was quite frustrating. We were hoping to see something like this:
Number of Logins from Data
Instead, we were getting stuff distributed like this:
Simulated Number of Logins
I realized that we needed some function to force a bunch of this junk further left. Recalling an old adage from Mr. Cone’s AP Chemistry class, I decided it was the right time to whack it with an X squared. This is vaguely appropriate, because rand() has a range [0,1), so squaring it should put a whole bunch of stuff further right, but not everything(ie, the first half will end up in the first quarter, the first 3/4 will end up in the first 9/16, etc). Imagine my shock when I saw this:
Simulated Number of Logins
This is almost picture perfect what we were hoping to see! I was expecting to see something like this, but I was not expecting it to work out so perfectly. The burden is now on trying to justify that choice…