Last active
January 2, 2022 02:45
-
-
Save asukaminato0721/999936f6f9e2db092ff7672f599e8046 to your computer and use it in GitHub Desktop.
https://youtu.be/7oV7hiAsVTI?t=2999 pi_approx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lei[n_Integer] := | |
Range[0, n] // | |
1 + 2 # & // | |
Partition[#, 2] & // | |
Map[1./Times @@ # &] // | |
Total // | |
#*8 &; | |
lei[10000] | |
lei2[n_Integer] := MapThread[#2 *1./#1 &, { | |
Range[0, n] // 1 + 2*# &, | |
Range[0, n] // (-1)^# &} | |
] // Total // #*4 & | |
lei2[10000] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment