What is Monte Carlo?

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2016
  • Here's a video describing programming magic: Monte Carlo integration!
    It's a super cool algorithm that is used all the time (in physics at least), so it was good to cover it here. We'll have more algorithms coming up, so be sure to check them out as they come along!
    Information on the Batman Curve:
    mathworld.wolfram.com/BatmanCu...
    math.stackexchange.com/questio...
    I also did a small write-up on integrating the Batman Curve:
    leios.github.io/Batman_Montecarlo
    As always, the simulations were done live on:
    / leioslabs
    / @leioslabslive
    Feel free to follow me on Twitter!

    The code is available here:
    github.com/leios/simuleios/bl...
    And the music is from Josh Woodward (sped up 1.5 times):
    www.joshwoodward.com/
    Thanks for watching!
    Also, discord:
    / discord
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 284

  • @LeiosLabs
    @LeiosLabs  6 ปีที่แล้ว +15

    Since making this video, we have created a new project called the Algorithm Archive and have added a chapter on Monte Carlo: www.algorithm-archive.org/chapters/monte_carlo/monte_carlo.html
    Please go there for information on how to code this up yourself!

  • @yolofapper9668
    @yolofapper9668 8 ปีที่แล้ว +132

    this is the best mathematical education video I ever saw,short,simple,no overcomplicated shit,just straight to the point

    • @LeiosLabs
      @LeiosLabs  8 ปีที่แล้ว +24

      That is exactly how I want the videos to be: As short as possible while still conveying the point. It takes forever to make 3 minutes of content, but that's alright.

    • @raqueloliveiramotivacional2348
      @raqueloliveiramotivacional2348 5 ปีที่แล้ว

      Yolo Fapper Monte Carlo

    • @J_46
      @J_46 4 ปีที่แล้ว

      Totally!

  • @AdnanKhan-so1ey
    @AdnanKhan-so1ey 6 ปีที่แล้ว +4

    After wasting an hour trying to understand an algorithm that shouldnt take more than 3 minutes to understand, I finally came across your video. You explained it perfectly. Thanks a lot

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว +1

      I'm glad it was helpful! =)

  • @AnujGupta-wp2ww
    @AnujGupta-wp2ww 4 ปีที่แล้ว +49

    Einstein once said "If you can't explain it to a 6 year old kid, your education about that topic in incomplete".
    Great explanation

    • @phythematics2188
      @phythematics2188 3 ปีที่แล้ว +7

      Einstein himself couldn't make understand scientists the Theory of relativity let alone a 6 years old kid.

    • @samuraijosh1595
      @samuraijosh1595 3 ปีที่แล้ว +1

      @@phythematics2188 Lol.

  • @jrwkc
    @jrwkc 7 ปีที่แล้ว +93

    Keep it up, you will hit youtube fame soon. Probably one of the best educators out there.

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว +8

      Thanks! I really appreciate it!

  • @jameshuang9568
    @jameshuang9568 4 ปีที่แล้ว +7

    I've been running through all youtube videos about his topic for hours and even the professor from MIT didn't answer my question. You are brilliant

  • @DanielDuesentrieb86
    @DanielDuesentrieb86 7 ปีที่แล้ว +17

    Monte Carlo methods are also very handy in game theory where it is easy to state the game rules, yet hard to precisely calculate the probability to win.

  • @victoriagee1059
    @victoriagee1059 3 ปีที่แล้ว +1

    This is one of the best explanations for Monte Carlo I have found. Good job, James!

  • @LeiosLabs
    @LeiosLabs  8 ปีที่แล้ว +1

    Alright! New video about Monte Carlo!
    This one was super fun to make (live on: www.twitch.tv/simuleios), especially the batman integration!
    Let me know what you think / if you have any comments, questions or concerns!
    Thanks for being awesome guys!

  • @naveenchandrakumar480
    @naveenchandrakumar480 5 ปีที่แล้ว +1

    Very Nice. This is first time I understood Monte Carlo method clearly. Thanks for the video

  • @forgettd
    @forgettd 3 ปีที่แล้ว

    This is the best explanation of anything I've ever seen on youtube. Thank you!

  • @harkirehal258
    @harkirehal258 4 ปีที่แล้ว

    This is an excellent explanation of a complex concept. I was glued to the video and understood every word. I wish I had you for my teacher when I was younger. I subscribed to your channel. I now want to learn everything you teach even if it just for fun. Its rare to find a teacher that explais a concpet to the core in a way that a layman understands.

  • @corporalwaffles
    @corporalwaffles 7 ปีที่แล้ว +1

    You earned a sub today, keep up these vids (along with algorithms) :D

  • @rishabtirupathi9431
    @rishabtirupathi9431 ปีที่แล้ว +1

    I was so scared that this video would be too complicated. Thank you so much for making it simple.

  • @kamruzzamankanon4794
    @kamruzzamankanon4794 5 หลายเดือนก่อน

    Concise+informative+to the point+easy example = My subscription!

  • @robertpretorius7627
    @robertpretorius7627 6 ปีที่แล้ว +3

    Short, simple, clear. Wow! Great video! I finally understand Monte Carlo simulations!

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      Yeah, it's crazy how random numbers can be so useful!

  • @vladscp6579
    @vladscp6579 10 หลายเดือนก่อน

    this is the coolest algorithm videos I've ever seen, better than most stuff in my uni

  • @Aa11qq
    @Aa11qq 7 ปีที่แล้ว +36

    This is an amazing explanation. Thank you!

  • @AbuSayed-er9vs
    @AbuSayed-er9vs 7 ปีที่แล้ว +1

    A lots of thanks for giving a valuable information.Please keep going on to do more and more videos with your amazing information.

  • @AashishMishra_Nygma
    @AashishMishra_Nygma 7 ปีที่แล้ว

    This channel is gonna touch the skies! I am happy that I am such an early subscriber!

  • @kemfic
    @kemfic 5 ปีที่แล้ว

    This is the best explanation I've seen on Monte Carlo so far

  • @lerneninverschiedenenforme7513
    @lerneninverschiedenenforme7513 3 ปีที่แล้ว

    Awesome! The only video, that can deliver 4 minute content in around 4 minutes (and not 10, 20 or 50, like the other videos)

  • @filiphradil95
    @filiphradil95 7 ปีที่แล้ว +2

    Awesome explanation! Finaly some non-boring video for numeric methods! :)

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว +1

      haha, I'm glad you liked it! I actually really like Monte Carlo. It was one of the first integration methods I learned and really helped me understand integration.

  • @PrettyMuchPhysics
    @PrettyMuchPhysics 5 ปีที่แล้ว

    It's amazing how many modern application use Monte Carlo! Great introduction video :D

  • @tudorversoiu8138
    @tudorversoiu8138 7 ปีที่แล้ว +1

    Never seen a better explanation on anything, ever. Amazing videos, just found your channel :)

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว

      I'm glad it was useful! =)

  • @OOnestly
    @OOnestly 6 ปีที่แล้ว

    Dude, you explained such a concept in 3 minutes. That was amazing!

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I'm glad it was helpful!

  • @charlesasmr7242
    @charlesasmr7242 6 ปีที่แล้ว +1

    you are amazing, and also very vivid ways to tell others the simulation process.

  • @jennis493
    @jennis493 6 ปีที่แล้ว +1

    Great Video! After a one semester course on computational science and still not quite getting what this was all about your video really cleared things up! Thank you!

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      Woo! I'm glad it was helpful! =)

  • @Tom-sp3gy
    @Tom-sp3gy 3 ปีที่แล้ว

    This is absolutely brilliant ! What a simple and short explanation ! Thankyou so much

  • @handlenotprovided
    @handlenotprovided 3 ปีที่แล้ว

    Very concise and straightforward explanation of monte carlo integration. Thank you

  • @snackbob100
    @snackbob100 4 ปีที่แล้ว

    you are going places my dude, keep it coming!

  • @shakilmasud
    @shakilmasud 3 ปีที่แล้ว

    Thank you. Searching for so many sites but here I cleared my conception :)

  • @ProXicT
    @ProXicT 7 ปีที่แล้ว +3

    This is the best explanation on the internet, thanks a lot!!

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว

      I'm glad it was helpful!

  • @bondmanu
    @bondmanu 7 ปีที่แล้ว +2

    Very much liked it....explained the complex definition very simply ...keep up the good work! :)

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว +1

      I'm super glad it was useful! =)

  • @TheRach995
    @TheRach995 3 ปีที่แล้ว +1

    My grandfathers research on Monte Carlo numbers was actually pretty important. Look up Martin J Berger, his world is all available online and his obituary is achieved by the Washington post, is available through a simple search. I’m so proud of him.

  • @JoannaBalasbas
    @JoannaBalasbas 7 ปีที่แล้ว +2

    thank you so much for explaining so well and concisely to beginners like us!

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว +1

      I'm glad it helped! =)

  • @HKHasty
    @HKHasty 6 ปีที่แล้ว

    Greatest explanation of Monte Carlo I've ever seen!

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I'm glad you found it useful!

  • @ashishbastola8412
    @ashishbastola8412 5 ปีที่แล้ว

    Short, sweet & amazing!

  • @SamiyuruSenarathna
    @SamiyuruSenarathna 5 ปีที่แล้ว

    You conveyed the point very clearly.

  • @jackyxue7885
    @jackyxue7885 6 ปีที่แล้ว +1

    I was out there reading papers and falling sleep. You saved my day. Simply and elegant ~~~

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I'm glad you liked it! When I saw this for the first time, I thought it was magic!

  • @ferdousadnan5814
    @ferdousadnan5814 5 ปีที่แล้ว +2

    An excellent excellent video, excellent explanation. Both liked and subscribed.

  • @LoserHands
    @LoserHands 4 ปีที่แล้ว +2

    I've always wanted to integrate odd shapes into a shooter videogame, for shotgun chokes.
    Maybe percent-error per shot can be used for boosting the unlucky shots, or the area-of-circumscribed-shape can be used to find the effectiveness of a shotgun choke, so the better ones cost more in a borderlands-style procgen.
    Also sometimes your videos make certain terms like integral wayyy less scary for someone like me, who has a lot of math left on their plate following high school and dropping college once. It's hard getting back into crowded class and math is totally smthn I don't want to fail. Ty

    • @LeiosLabs
      @LeiosLabs  4 ปีที่แล้ว

      I'm happy this was useful! I'm interested to see how you work this out for your game. It could be really cool!

  • @prathameshpradipdatar2003
    @prathameshpradipdatar2003 3 ปีที่แล้ว

    Simple, elegant and impactful!

  • @ozzyfromspace
    @ozzyfromspace 5 ปีที่แล้ว +1

    Wow, you did that in less than 4 minutes. Bravo!

  • @kaarla2805
    @kaarla2805 3 ปีที่แล้ว

    Omg i just discover your videos and they’re amazing, thanks for share.

  • @yassertalebi1026
    @yassertalebi1026 4 ปีที่แล้ว

    Many thanks Sir, you made as easy as could have been possible, I was watching MIT 's course for 55 min wasn't that clear as you were

  • @saitaro
    @saitaro 6 ปีที่แล้ว

    Best Monte Carlo advertisement I've ever seen. The slogan @ 3:26 is great

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I like my videos to advertise algorithms. It's better to motivate people to learn.

  • @prateekverma6873
    @prateekverma6873 7 ปีที่แล้ว +1

    Nice video!. the explanation was easy and understandable.

  • @harshavardhan9660
    @harshavardhan9660 7 ปีที่แล้ว +1

    Thanks a lot bro;Atlast I've found the platform for visualizing the concepts clear.Keep it up..

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว

      I'm glad it was useful! I've been trying to get more videos out, but with work and everything, it takes a little longer then I'd like...

  • @Aa-tf1li
    @Aa-tf1li 6 ปีที่แล้ว +1

    I made a long research to understand this topic and I can't reach to the nut...
    your video is very helpful , it summarise whole idea in simple concepts, thanx for ur efforts

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      Yeah, there are a lot of concepts that seem super complicated at first glance, but are much easier after you get used to them a little.

  • @scose
    @scose 6 ปีที่แล้ว +1

    The Batman example showed how to use Monte Carlo methods to find the area of a complex domain. More generally, we can think of integrating f(x) * p(x) where p(x) is a probability distribution. In your example f(x) is the indicator function of the batman logo and p(x) is the uniform distribution on the ellipse. But we could also extend this to something more complicated e.g. if f(x) = x and p(x) is the uniform distribution over the logo itself, we can find the center of mass of the logo. Or, if p(x) is not a uniform distribution, we can use importance sampling or Markov Chain Monte Carlo methods to compute the expected value of a function of a random variable. (commenting for other viewers - as a physicist I guess you already know this)

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว +2

      Yeah. I want to cover some of this stuff in the future soon (tm)!

  • @Rotwh7
    @Rotwh7 7 ปีที่แล้ว +7

    Sir, I hope you read this comment. You are brilliant and kind. GOD bless You! Keep educating us like this Sir!

  • @qiuzhishu2583
    @qiuzhishu2583 7 ปีที่แล้ว +1

    Really nice! Easy to understand!

  • @srik24
    @srik24 5 ปีที่แล้ว

    A thorough explanation. Thanks!!

  • @aminsn779
    @aminsn779 4 ปีที่แล้ว +1

    great, easy, and fast explanation. exactly what I needed :))
    Thank you.

    • @LeiosLabs
      @LeiosLabs  4 ปีที่แล้ว

      Great to hear!

  • @abdulelahaljeffery6234
    @abdulelahaljeffery6234 7 ปีที่แล้ว +2

    omg!! dude you are definitely one of them! a rare bread of human beings who know how to explain things really well, congrats! (clapping)

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว +1

      Haha, I'm glad you like the content! =)
      Let me know if you have any questions!

    • @abdulelahaljeffery6234
      @abdulelahaljeffery6234 7 ปีที่แล้ว +1

      I most certainly will ..

  • @matt9912
    @matt9912 7 ปีที่แล้ว +13

    Very nicely done!

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว

      Glad it was helpful!

  • @khudhurm7709
    @khudhurm7709 7 ปีที่แล้ว +1

    Amazing explanation! Subscribed :)

  • @greenowski
    @greenowski 3 ปีที่แล้ว

    This is exactly what I was looking for! thanks :)

  • @aashmavlogs5512
    @aashmavlogs5512 4 ปีที่แล้ว

    Thank you so much. You explained it with simplicity.

  • @peter9910
    @peter9910 7 ปีที่แล้ว +1

    Great explanation, thanks!

  • @ujjayantabhaumik3109
    @ujjayantabhaumik3109 5 ปีที่แล้ว

    This was really cool. You explained it so nicely. Gracias :)

  • @TheFitAuto
    @TheFitAuto 6 ปีที่แล้ว +1

    I understand exactly about Monte Carlo calculation after seeing this video..many thanks!!

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      Great! I am glad it was helpful! =)

  • @bluecpp2059
    @bluecpp2059 3 ปีที่แล้ว

    Thank you for this great video. I will read more about it.

  • @cameronmiller4144
    @cameronmiller4144 4 ปีที่แล้ว +1

    concise and entertaining. thanks!

  • @ashish6114
    @ashish6114 7 ปีที่แล้ว +16

    You sir should have more subs. The presentation of the concepts is super intuitive and easy to absorb thanks to the proper and simple explanations provided unlike the majority of college professors who unnecessarily complicate the matter due to their inadequate teaching skills. Sometimes I think that they became professors simply because they held 'PhDs'.

    • @ashish6114
      @ashish6114 7 ปีที่แล้ว +1

      I've seen the other videos of yours too. It'd be amazing if you were a professor. We need more people who teach in such simple and intuitive ways.

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว

      Honestly, I would love to be a professor. It's one of my dream jobs!

  • @kshitijkulkarni8698
    @kshitijkulkarni8698 7 ปีที่แล้ว +1

    Thank you for making this video!!

  • @deeptivirgo2009
    @deeptivirgo2009 6 ปีที่แล้ว

    Very nice Explanation ! Thanks a lot!

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      Thanks! I am glad it was useful!

  • @tusharkush7
    @tusharkush7 4 ปีที่แล้ว

    Great Explaination!

  • @arturotorreslopez4283
    @arturotorreslopez4283 5 ปีที่แล้ว +6

    And that's another precious way of calculating pi :D

  • @bharatkukreti8449
    @bharatkukreti8449 6 ปีที่แล้ว +1

    Very well explained the Jargon.

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I'm glad it was useful!

  • @locopepele
    @locopepele 7 ปีที่แล้ว

    Great explanation! Thank you!

  • @ElMakk_Med
    @ElMakk_Med 4 ปีที่แล้ว

    hey there, thanks for this awesome work, i just wanna ask what is the software you used to make the simulation in the video?

  • @thyagtubes
    @thyagtubes 5 ปีที่แล้ว

    Very well done

  • @aming.alhashim-ou6032
    @aming.alhashim-ou6032 7 ปีที่แล้ว +1

    Well done! You are a great teacher.

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว +1

      I'm glad you found it useful!

  • @theinstigatorr
    @theinstigatorr 7 ปีที่แล้ว +1

    Nice video. I'm surprised it doesn't have more views

  • @abubakerbarenis
    @abubakerbarenis 6 ปีที่แล้ว +1

    very nice explanation, appreciated..

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I'm glad it was helpful!

  • @juusokorhonen1628
    @juusokorhonen1628 4 ปีที่แล้ว

    I have one question. If thinking about more complex function (still in xy-plane for simplicity) how do we know if the randomly selected dot is under the curve or over it? Like ofc we as humans can see it, but how to tell computer about it, how to code it in? Probably it is a stupid question, but it just popped into my head

  •  7 ปีที่แล้ว +1

    I should've found this video several hours ago! Nice!

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว

      I'm glad it was helpful!

  • @williamehrhardt918
    @williamehrhardt918 5 ปีที่แล้ว

    I used monte carlo integration in my masters thesis to approximate the volume contained in a specific electron density of a molecule.
    Advantage: You can get decent accuracy in a small amount of time.
    Disadvantage: If you need highly accurate values, it scales very poorly. To halve the area requires a squared number of points.
    Tesselation is better in pretty much every way

  • @GBWF1984
    @GBWF1984 5 ปีที่แล้ว

    I just want to thank you for this great video. Also, I took sometime to visit the Arcane Algorithm Archive, very nice work!! Congratulation!!

  • @md.abdullahal-alamin8059
    @md.abdullahal-alamin8059 7 ปีที่แล้ว +1

    At last I understood monte carlo simulation. Thanks :)

    • @LeiosLabs
      @LeiosLabs  7 ปีที่แล้ว +2

      I'm glad it was helpful!

  • @SuperMaDBrothers
    @SuperMaDBrothers 3 ปีที่แล้ว

    Not bad. You could have mentioned how the points are actually sampled though (how they’re uniform. And are there nonuniform uses?)

  • @kishangovind8499
    @kishangovind8499 6 ปีที่แล้ว +1

    Thanks a lot . Nicely explained

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I'm glad it was useful!

  • @Manu-sz4mo
    @Manu-sz4mo 6 ปีที่แล้ว

    Simply AWESOME

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      Yeah, batman took a while...

  • @pman-codes
    @pman-codes 5 ปีที่แล้ว

    short and awesome

  • @FamMeierundCo
    @FamMeierundCo 4 ปีที่แล้ว

    Oh my god awesome video!

  • @walidwalid9991
    @walidwalid9991 7 ปีที่แล้ว +1

    Thank you so much for this explanation. your student from Algeria

  • @Ravikumar_Sharma
    @Ravikumar_Sharma 5 ปีที่แล้ว

    Excellent!

  • @karimaelouahmani7078
    @karimaelouahmani7078 2 ปีที่แล้ว

    i am soooo thankful

  • @macenkajan
    @macenkajan 6 ปีที่แล้ว

    The quality of such simulations highly depend on the quality (mainly Periodicity) and implementation of your PRNG, in such a video you should always state which algorithm is used and from which lirary.

  • @aln447
    @aln447 5 ปีที่แล้ว

    Brilliant!

  • @IanFarias00
    @IanFarias00 5 ปีที่แล้ว

    Amazing video! ^^

  • @cupofkoa
    @cupofkoa 6 ปีที่แล้ว

    You're one of the few that don't say 'click like and subscribe'. Its because you don't need to because you're stuff is good. Hitting that subscribe button now.

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      Ah, thanks man! I don't tell people to like and subscribe because I hate watching people who say that. People know what to do. I don't need / want to tell them. I would honestly feel bad if people only subscribed to me because I told them to.

  • @AhmedHatem1996
    @AhmedHatem1996 6 ปีที่แล้ว +1

    Awesome Explanation .. Thank you so much

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว

      I'm glad it was useful!

  • @MrZouzan
    @MrZouzan 5 ปีที่แล้ว

    2 sec of this vid and u got a new suscriber !

  • @prithvib8662
    @prithvib8662 5 ปีที่แล้ว +4

    I have another question: Why does the sampling have to be random? Would using a grid of dense and equidistant points have the same effect?
    Also, can this work in 3D to find volume?

    • @sakibhasan7857
      @sakibhasan7857 2 ปีที่แล้ว

      yes it does works in 3D

    • @mettaursp309
      @mettaursp309 ปีที่แล้ว +1

      Super late response, but for reference for anyone who comes across this: because of the way it can be applied more universally than just this one scenario.
      Not all scenarios it can be used in have an equivalent concept of equidistant intervals. Additionally, not all functions you would want to test with Monte Carlo have clearly defined regions in values, and you might have an unknown amount of variance that you want to attempt to measure.
      As an example you can use it on physically based rendering (PBR) materials with randomly sampled surface normals (kinda surface facing direction) to measure average light influence. You don't know what a reflected ray would hit when bounced off in a specific direction so it makes more sense to average randomly distributed normals than even incremental changes in surface normals.

    • @prithvib8662
      @prithvib8662 ปีที่แล้ว

      @@mettaursp309 that makes sense, thanks!

  • @GeorgeSandle
    @GeorgeSandle 6 ปีที่แล้ว

    Very well explained :)

    • @LeiosLabs
      @LeiosLabs  6 ปีที่แล้ว +1

      Thanks! The point is to provide quick, intuitive descriptions of things.

  • @vincenthuang5228
    @vincenthuang5228 3 ปีที่แล้ว

    So how does the program know whether a random point is in the region we what to integrate over?

  • @reinia127
    @reinia127 4 ปีที่แล้ว

    Thank you so much sir!!