Began the equation by assuming the fact that the lot was circular was essentially an extra detail that mattered very little to the eventual outcome since the circumference can basically be regarded as a circle laid out flat. So assuming a 100 unit long straight line, and a gap of 1 unit between the cars as the highest gap (rather than say 1.99999 repeated which would lead to 25 cars instead of whatever limit you said later), came up with this code that would linearly determine how many cars would fit.
PHP Code:
function onCreated(){
temp.val1 = findMin(100, 2);
temp.val2 = findMax(100, 2);
echo(val1);
echo(val2);
for(temp.i = 0; i < 100; i++){
temp.val3 += findRand(100, 2);
}
echo(val3/100);
}
function findRand(n, i){
temp.space = 0;
temp.gap = i - random(1, 2);
temp.isgap = false;
temp.cars = 0;
while(space < n){
isgap = !isgap;
if(isgap){
space += gap;
}
else{
space += i;
cars++;
}
}
return cars;
}
function findMin(n, i){
temp.space = 0;
temp.gap = i - 1;
temp.isgap = false;
temp.cars = 0;
while(space < n){
isgap = !isgap;
if(isgap){
space += gap;
}
else{
space += i;
cars++;
}
}
return cars;
}
function findMax(n, i){
return int(n/i);
}
Output:
The results if plotted for each random iteration would wind up being a sort of diamond leading around the value of min + max / 2, causing the average to approach that value.