Post Reply 
Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others]
03-23-2020, 04:34 PM (This post was last modified: 03-23-2020 07:07 PM by Albert Chan.)
Post: #30
RE: Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others]
Inspired by Valentin Albillo post on estimating Pi using random numbers.
And, the proof for it: https://math.stackexchange.com/questions...379#885379

LN(2) = 2 * probability of integer part of RND/RND is odd

10 INPUT K @ N=0 @ FOR I=1 TO K @ N=N+MOD(IP(RND/RND),2) @ NEXT I @ DISP 2*N/K @ GOTO 10

> RANDOMIZE 1
> RUN
? 1E3     → .68
? 1E3     → .756
? 1E4     → .6806
? 1E4     → .6938
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Natural logarithm of 2 [HP-15C/HP-42S/Free42 & others] - Albert Chan - 03-23-2020 04:34 PM



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