3 coin flip Monte Carlo simulation in Clojure
https://clojure-diary.gitlab.io/2024/10/18/3-coin-flip-monte-carlo-simulation-in-clojure.html
Code ;; three_coin_toss_montecarlo.clj ;; Montecarlo simulation of 3 coin toss (defn toss-thrice [] (repeatedly 3 #(rand-nth [“H” “T”]))) (defn samples [num] (repeatedly num toss-thrice)) (defn nil-to-zero [x] (if (nil? x) 0 x)) (defn…
You must log in or register to comment.