Post Reply 
[VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math"
02-15-2021, 10:08 PM (This post was last modified: 02-15-2021 11:03 PM by ramon_ea1gth.)
Post: #6
RE: [VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math...
I tried the weird limit in my physical HP 50g in User-RPL, reaching 100,000 iterations. When I saw the outcome going to e, some kind of law of large numbers came to my mind.

Input stack:
2: number of tests, CNT
1: limit to exceed, XCD (e.g., 1, pi)

My code:
« 0 → CNT XCD TOT
« 1 RDZ
1 CNT FOR I
RAND 1 → TMP NR
« DO RAND 'TMP' STO+ 1 'NR' STO+
UNTIL TMP XCD >
END
NR 'TOT' STO+
»
NEXT
TOT CNT /
»
»

Ramón
Valladolid, Spain
TI-50, Casio fx-180P, HP48GX, HP50g, HP Prime G2
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math... - ramon_ea1gth - 02-15-2021 10:08 PM



User(s) browsing this thread: 1 Guest(s)