This has been doing great for now but what I’m really keen of figuring out involves 3 variables.
let’s call them X, Y and pancake. I mean Z.
X is the Lower Limit. The extreme smallest possible value.
Z is the Upper Limit. The extreme largest possible value.
Y’s out? Y? Because : Y’s the tricky one.
Y is the Average.
[code]To decide what number is (x - a number) d (y - a number):
let total be 0;
repeat with index running from 1 to x:
now total is total plus a random number between 1 and y;
decide on total.
To decide what number is a gaussian number between (x - a number) and (y - a number):
let n be (y minus x) + 1;
decide on (n d 2) plus x minus n.[/code]
This code always puts Y in the middle between X and Z.
But what if I want to simulate death ages? Some die young, some die ancient, but most die at… oh I’m too tired to Google the exact number. Let’s say the “average” here would be 80. Sad truth is that some die within days. (don’t mean to bring anyone down but this is the most practical example I can think of) So the lower limit would be 0. Upper limit would be the age of the oldest living human being. Which is, what? 120? Let’s say it is, so that we can get a move on with this.
What trickery is this?! Difference between X and Y is exactly double of that between Y and Z.
That would make the curve drop from Y to Z twice as hard as the curve rises from X to Y.
IF we want curve in the opposite direction: SEX! (now that I have your attention, let’s move on to the next example)
let’s say we want a curve about how much sex people have. Or claim they have. Whatever.
Let’s start with the lower limit. This won’t be realistic but the real lower limit disgusts me.
X is 16. Nobody under sixteen fucks. Anywhere. Ever. Doesn’t happen. This is my example, sit down.
Let’s assume that people get lucky until the day they die. Since I made the upper limit of life 120, I readopt that value. Z is 120.
Let’s make it all wobbly. I started getting tired around 25. Fuck it. Y is 25.
That makes a freakin’ steep pull up between 16 and 25 of [hums porn soundtrack] and then a very gentle decline that then becomes a bit of a drop and then becomes a gentle decline again until you reach 120.
Something like that - is that possible?
I lack the skill to include that third variable.