While your for loop may not directly result in a normal distribution, it does lead to an interesting pattern of outcomes resembling one. The ending condition being based on a random number introduces variability into the loop's termination point, making it unpredictable.
This setup creates a scenario akin to a bell curve, where certain values are more likely to be reached than others. The chances of the loop ending within a specific range, such as 200 to 800, are notably higher compared to extreme values outside of this range.
The underlying logic involves the incrementing value x and its relationship with the randomly generated comparison number. Initially, hitting the target can be challenging due to low x values requiring a very small random number. However, as x grows, the likelihood of meeting the condition increases since each roll has a chance to match the current x value.
Eventually, the probability of success rises as it becomes statistically more probable for a sufficiently low random number to occur and surpass the increasing x value. This trend continues until the loop inevitably meets its end based on the randomness of the generator.