-
- Notifications
You must be signed in to change notification settings - Fork 359
Added Monte Carlo in Clojure #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
btw could someone explain why the division by r2 |
You are essentially solving for |
haskell monte carlo yeah but What is confusing is the haskell code it doesn't even have r2<\sup> , and honesly I tried both formulas and got different results |
That's because he set the |
sorry @leios it doesn't seem to work with me when using different radiuses so I'm sticking with my code |
hey @Gathros how did you add a label |
It's on the right hand side, just click labels and select the label. |
@earthfail As a note: I typed the original equation wrong. It should be Does it work with that formula? |
well from what I understand |
My Code runs fine and gets close results to pi. Just wanted to point out what I didn't understand |
Hey @earthfail Sorry it's taking so long for this PR, we don't have enough people who understand clojure to review it. |
That got me think should I link to a guide where people can get a repl or something to play with code. |
@earthfail do you still have trouble understanding the normalization? I can try to explain if you want. In my Haskell code I hardcoded the radius to 1, since it's the best value anyway, but I can justify it ^^ |
After looking at your code, I understand why you don't need to renormalize. leios is using a random number between 0 and 1, you are using a random number between 0 and r. The scale of your box and your circle are matching so you don't need to renormalize. Does that make sense? |
Thanks @jiegillet , you guys are the best |
I read the code, I think I understood it and it's ready to go. Could I ask that you add some kind of main function that tests the function and prints out the value of pi and the error percentage? Just so that people who don't know Clojure (like me) can play around and test the function. |
sorry @Butt4cak3 I tried your method from discord but couldn't make it less than two commits have a nice weekend guys |
Uhm... What's that "image modification" commit? Are you running Windows? Could you tell me what the output of |
I'm using ubuntu linux with git 2.7.4 What I done is: git clone my repo |
Thanks for the modification, @earthfail, that's what I wanted. |
Do you think if I remove my remote repo it will work? |
@earthfail You will probably need to revert your changes to a previous state before the images were modified, and then pull the latest changes from the AAA upstream repo. Removing your repo doesn't change the commit history. |
@earthfail Yeah, that version of git is a bit old. We changed our Removing your repo won't work as long as you have the old version of git installed. It will always mark the images as modified. I'm afraid the only way to get around this is to update git. |
sorry guys for not contributing much but some topics are really hard like FFT