Browse Search Popular Register Upload Rules User list Login:
Search:
1 in 100 chance of a random Hit

Image:
screenshot of the scene

Author: Xray

Group: Default

Filesize: 20.21 kB

Date added: 2023-09-13

Rating: 6.1

Downloads: 1765

Views: 435

Comments: 7

Ratings: 3

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

This is a response to the scene "1 in 100 chance of turning a square green" by user "im557".

He claims that there is a 1 in 100 chance of turning a square green when clicking on it. Well, after playing around with his scene, I started wondering "Is his claim actually true?". So, I decided to test his claim by making this response scene which uses his Thyme Script that generates the random numbers. His script uses the random number generator called "rand.uniform01". It's called that because it generates random real numbers within the range of 0.0 to 1.0 with a uniform distribution over time. That means any number within that range has an equal chance of showing up as any other number. User im557 normalized the generated values by multiplying each real number by 100, adding 0.5 (to round up the number), and then stripping off the decimal portion so that the result is an integer within the range of 0 to 100. He then used the integer 99 as a trigger for counting as a "Hit". He could have used any other integer within that range because of the fact that the distribution is uniform. The main thing that's different between our scenes is his scene requires a user to click on a square which produces only one data point. Either the square will turn green or it will remain white. Over time the square will turn green 1 out of 100 clicks. I wanted to automate the clicks so my scene generates a random number every 1/10 of a second (approximately). After 100 automated clicks, a tally of hits is then used to calculate the running average. A set of 100 clicks I call a cycle. The general way probability works is the larger the data population is, the more accurate will be the result. That's especially true for taking the average of a data set. For example, some cycles will generate no hits (zero data values) and some cycles will generate multiple hits (2 to 6 data values). I found that it can require at least 30 cycles in order to get a result very close to 1. But that will probably change each time you run the scene. If you are in a hurry, you can speed up the calculations by increasing the "Simulation Speed".

Want to see how many different random number generators Thyme Script has? Well, here ya go!: Random Number Generators
Last edited at 2023/09/15 00:52:01 by Xray
Please log in to rate this scene
edit
Similar scenes
Title: FFC3B-"Random Chance Elim"
Rating: 5
Filesize: 1.07 MB
Downloads: 153
Comments: 7
Ratings: 1
Date added: 2018/02/19 05:00:08
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Algotriacontathlon II Day 2 (Survival)
Rating: 5
Filesize: 15.45 kB
Downloads: 1530
Comments: 1
Ratings: 1
Date added: 2019/11/23 17:54:17
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Wheel of Luck
Rating: 5
Filesize: 196.83 kB
Downloads: 741
Comments: 9
Ratings: 1
Date added: 2017/01/16 01:34:59
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: booking1027 scene response
Rating: 5
Filesize: 316.66 kB
Downloads: 486
Comments: 1
Ratings: 1
Date added: 2011/06/06 05:18:23
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: coinflip
Rating: 5.625
Filesize: 34.8 kB
Downloads: 504
Comments: 2
Ratings: 2
Date added: 2020/01/19 07:34:03
Made with: Algodoo v2.1.0
Rating: rated 5.6
download
Title: Virtual Dice
Rating: 6.3
Filesize: 153.36 kB
Downloads: 1000
Comments: 5
Ratings: 4
Date added: 2010/04/24 14:38:05
Made with: Phun
Rating: rated 6.3
download
This scene is a response to
show list
Title: 1 in 100 chance of turning a square green
Rating: 5
Filesize: 54.85 kB
Downloads: 645
Comments: 0
Ratings: 1
Date added: 2023/09/12 02:42:25
Made with: Algodoo v2.1.0
Rating: rated 5
download
:tup: Good scene, demonstrates the random number generator quite well!
Thanks Little! :)
I got 3 hits in one cycle_o_





also nice job:tup:
Thanks Leaderboard!

BTW - It's not a game and it's not about how many hits you can get in one cycle. It's totally random. Some cycles you'll get zero hits and some cycles you'll get quite a few hits. That's the nature of probability, and that's the nature of our entire reality (but that's a different subject).
Last edited at 2023/09/15 00:41:47 by Xray
Thanks for that!:)
nice actually
Thank you.