What is Monte Carlo?

Поділитися
Вставка
  • Опубліковано 24 січ 2025

КОМЕНТАРІ • 282

  • @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 7 років тому +5

    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  7 років тому +2

      I'm glad it was helpful! =)

  • @AnujGupta-wp2ww
    @AnujGupta-wp2ww 5 років тому +51

    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 4 роки тому +8

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

    • @samuraijosh1595
      @samuraijosh1595 4 роки тому +1

      @@phythematics2188 Lol.

  • @jameshuang9568
    @jameshuang9568 5 років тому +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

  • @jrwkc
    @jrwkc 8 років тому +93

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

    • @LeiosLabs
      @LeiosLabs  8 років тому +8

      Thanks! I really appreciate it!

  • @rishabtirupathi9431
    @rishabtirupathi9431 Рік тому +1

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

  • @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.

  • @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)!

  • @TheRach995
    @TheRach995 4 роки тому +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.

  • @victoriagee1059
    @victoriagee1059 4 роки тому +1

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

  • @naveenchandrakumar480
    @naveenchandrakumar480 6 років тому +1

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

  • @abdulelahaljeffery6234
    @abdulelahaljeffery6234 8 років тому +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  8 років тому +1

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

    • @abdulelahaljeffery6234
      @abdulelahaljeffery6234 8 років тому +1

      I most certainly will ..

  • @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.

  • @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!

  • @filiphradil95
    @filiphradil95 8 років тому +2

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

    • @LeiosLabs
      @LeiosLabs  8 років тому +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.

  • @vladscp6579
    @vladscp6579 Рік тому

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

  • @jackyxue7885
    @jackyxue7885 7 років тому +1

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

    • @LeiosLabs
      @LeiosLabs  7 років тому

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

  • @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! =)

  • @robertpretorius7627
    @robertpretorius7627 7 років тому +3

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

    • @LeiosLabs
      @LeiosLabs  7 років тому

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

  • @kamruzzamankanon4794
    @kamruzzamankanon4794 Рік тому

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

  • @Aa11qq
    @Aa11qq 7 років тому +35

    This is an amazing explanation. Thank you!

  • @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!

  • @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)

  • @forgettd
    @forgettd 4 роки тому

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

  • @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! =)

  • @PrettyMuchPhysics
    @PrettyMuchPhysics 6 років тому

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

  • @saitaro
    @saitaro 7 років тому

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

    • @LeiosLabs
      @LeiosLabs  7 років тому

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

  • @kemfic
    @kemfic 6 років тому

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

  • @OOnestly
    @OOnestly 6 років тому

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

    • @LeiosLabs
      @LeiosLabs  6 років тому

      I'm glad it was helpful!

  • @TheCosmicBuffet
    @TheCosmicBuffet 4 роки тому

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

  • @ProXicT
    @ProXicT 8 років тому +3

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

    • @LeiosLabs
      @LeiosLabs  8 років тому

      I'm glad it was helpful!

  • @Rotwh7
    @Rotwh7 8 років тому +7

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

  • @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.

  • @AashishMishra_Nygma
    @AashishMishra_Nygma 7 років тому

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

  • @bondmanu
    @bondmanu 8 років тому +2

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

    • @LeiosLabs
      @LeiosLabs  8 років тому +1

      I'm super glad it was useful! =)

  • @shakilmasud
    @shakilmasud 4 роки тому

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

  • @HKHasty
    @HKHasty 6 років тому

    Greatest explanation of Monte Carlo I've ever seen!

    • @LeiosLabs
      @LeiosLabs  6 років тому

      I'm glad you found it useful!

  • @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.

  • @JoannaBalasbas
    @JoannaBalasbas 8 років тому +2

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

    • @LeiosLabs
      @LeiosLabs  8 років тому +1

      I'm glad it helped! =)

  • @corporalwaffles
    @corporalwaffles 7 років тому +1

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

  • @ozzyfromspace
    @ozzyfromspace 6 років тому +1

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

  • @arturotorreslopez4283
    @arturotorreslopez4283 6 років тому +6

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

  • @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

  • @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...

  • @Tom-sp3gy
    @Tom-sp3gy 4 роки тому

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

  • @charlesasmr7242
    @charlesasmr7242 7 років тому +1

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

  • @williamehrhardt918
    @williamehrhardt918 6 років тому

    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

  • @SamiyuruSenarathna
    @SamiyuruSenarathna 6 років тому

    You conveyed the point very clearly.

  • @ferdousadnan5814
    @ferdousadnan5814 6 років тому +2

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

  • @bharatkukreti8449
    @bharatkukreti8449 7 років тому +1

    Very well explained the Jargon.

    • @LeiosLabs
      @LeiosLabs  7 років тому

      I'm glad it was useful!

  • @matt9912
    @matt9912 8 років тому +13

    Very nicely done!

    • @LeiosLabs
      @LeiosLabs  8 років тому

      Glad it was helpful!

  • @TheFitAuto
    @TheFitAuto 7 років тому +1

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

    • @LeiosLabs
      @LeiosLabs  7 років тому

      Great! I am glad it was helpful! =)

  • @prathameshpradipdatar2003
    @prathameshpradipdatar2003 4 роки тому

    Simple, elegant and impactful!

  • @prithvib8662
    @prithvib8662 6 років тому +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 3 роки тому

      yes it does works in 3D

    • @mettaursp309
      @mettaursp309 2 роки тому +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 2 роки тому

      @@mettaursp309 that makes sense, thanks!

  • @snackbob100
    @snackbob100 5 років тому

    you are going places my dude, keep it coming!

  • @coffeeandproofs
    @coffeeandproofs 7 років тому +1

    On one hand I'm really happy an algorithm like this exists and honestly sounds fun to code -- but from a mathematics standpoint I'm sad within programming there doesn't exist a more precise and less computationally straining way to find the area/volume/space taken up by these shapes :/

    • @LeiosLabs
      @LeiosLabs  7 років тому +2

      To be fair, there are plenty of algorithms that are more precise than Monte Carlo. It's just a really cool algorithm!

  • @michaelharrison1093
    @michaelharrison1093 6 років тому +2

    There is a problem with this method that gets over looked or ignored and that is related to how truely random your sample points are. Obviously the chalk dots on the chalk board is not really that random. A computer is pretty good however at creating a single random number, however when you create an iterative program that uses a random number function then you find the fact that your program is executing the random function at a regular sample rate the random function no longer appears to be truely random. You can try to improve things by adding a random delay in your program loop to avoid the regular sampling period and this can improve the apparent randomness but by simply scaling this random delay and then experimenting with different scaling factors you can find certain scale factors that clearly do not generate random scatter patterns.

    • @LeiosLabs
      @LeiosLabs  6 років тому +3

      Yeah. We definitely need to talk about randomness (Diehard tests, even). Thanks for bringing it back up to my attention. I'll bump this up on the list!

  • @aminsn779
    @aminsn779 4 роки тому +1

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

  • @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.

  • @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!

  • @kaarla2805
    @kaarla2805 4 роки тому

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

  • @prateekverma6873
    @prateekverma6873 7 років тому +1

    Nice video!. the explanation was easy and understandable.

  • @cameronmiller4144
    @cameronmiller4144 4 роки тому +1

    concise and entertaining. thanks!

  • @theinstigatorr
    @theinstigatorr 7 років тому +1

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

  • @qiuzhishu2583
    @qiuzhishu2583 7 років тому +1

    Really nice! Easy to understand!

  • @srik24
    @srik24 6 років тому

    A thorough explanation. Thanks!!

  •  7 років тому +1

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

    • @LeiosLabs
      @LeiosLabs  7 років тому

      I'm glad it was helpful!

  • @peter9910
    @peter9910 8 років тому +1

    Great explanation, thanks!

  • @ashishbastola8412
    @ashishbastola8412 5 років тому

    Short, sweet & amazing!

  • @aashmavlogs5512
    @aashmavlogs5512 4 роки тому

    Thank you so much. You explained it with simplicity.

  • @abubakerbarenis
    @abubakerbarenis 7 років тому +1

    very nice explanation, appreciated..

    • @LeiosLabs
      @LeiosLabs  7 років тому

      I'm glad it was helpful!

  • @greenowski
    @greenowski 4 роки тому

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

  • @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!

  • @shakazoulu1135
    @shakazoulu1135 6 років тому +2

    How do the dots know that they have been placed in the correct area? I mean, there must be an algorithm painting the dots green or red and based on that, derive the underlying distribution??

    • @LeiosLabs
      @LeiosLabs  6 років тому +2

      So for the circle example, all we did was check wether x^2 + y^2

    • @shakazoulu1135
      @shakazoulu1135 6 років тому

      Thank you!

    • @Daniel-cz9gt
      @Daniel-cz9gt 6 років тому

      What I was thinking, doesn't the function to determine whether the dots are inside the area already assumes a lot of information about the area?

  • @aming.alhashim-ou6032
    @aming.alhashim-ou6032 8 років тому +1

    Well done! You are a great teacher.

    • @LeiosLabs
      @LeiosLabs  8 років тому +1

      I'm glad you found it useful!

  • @sadkacadmy2412
    @sadkacadmy2412 7 років тому +1

    a great touterial .i was wonder if there is a wan on MCMC method ??

    • @LeiosLabs
      @LeiosLabs  7 років тому

      Eventually, I would love to!

  • @juusokorhonen1628
    @juusokorhonen1628 5 років тому

    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

  • @ujjayantabhaumik3109
    @ujjayantabhaumik3109 6 років тому

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

  • @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?)

  • @bluecpp
    @bluecpp 4 роки тому

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

  • @deeptivirgo2009
    @deeptivirgo2009 6 років тому

    Very nice Explanation ! Thanks a lot!

    • @LeiosLabs
      @LeiosLabs  6 років тому

      Thanks! I am glad it was useful!

  • @cjunsun
    @cjunsun 4 роки тому +1

    May i know what software (for example, R, Matlab, python, etc) or platform you write codes on to carry out Monte Carlo simulations? Teacher LeiosOS, Thank you.

    • @LeiosLabs
      @LeiosLabs  4 роки тому

      You can write monte carlo in any language and do similar visualizations with basic plotting software. Here's the relevant chapter on the Algorithm Archive: www.algorithm-archive.org/contents/monte_carlo_integration/monte_carlo_integration.html
      You can change the language at the top-left

    • @cjunsun
      @cjunsun 4 роки тому

      @@LeiosLabs Got it. Thank you so much.

  • @MrZouzan
    @MrZouzan 6 років тому

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

  • @locopepele
    @locopepele 7 років тому

    Great explanation! Thank you!

  • @tusharkush7
    @tusharkush7 4 роки тому

    Great Explaination!

  • @thyagtubes
    @thyagtubes 5 років тому

    Very well done

  • @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!!

  • @Hunar1997
    @Hunar1997 5 років тому

    I still don't understand one thing, why use random points instead of a uniform grid of points? what is the advantage?

  • @khudhurm7709
    @khudhurm7709 7 років тому +1

    Amazing explanation! Subscribed :)

  • @kshitijkulkarni8698
    @kshitijkulkarni8698 7 років тому +1

    Thank you for making this video!!

  • @karimhassan5912
    @karimhassan5912 7 років тому +1

    Best educator out there on UA-cam. Not far from being famous

    • @LeiosLabs
      @LeiosLabs  7 років тому +1

      I'm glad you found it useful! =)

  • @vincenthuang5228
    @vincenthuang5228 4 роки тому

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

  • @mosama22
    @mosama22 8 років тому +1

    Beautiful! Beautiful! Beautiful! Beautiful!............. till forever ends..................
    Thank You!

    • @LeiosLabs
      @LeiosLabs  8 років тому

      Haha, I'm glad it was useful! =)

  • @ayushagarwal8720
    @ayushagarwal8720 5 років тому

    At 2:49, the Percent Error jumps to 4 percent for a short time.
    Can someone please explain it?

    • @ugururesin8405
      @ugururesin8405 5 років тому

      @Ayush Agarwal it's not 4 percent but 4.30429e-05 which corresponds to 0.0000430429

    • @ayushagarwal8720
      @ayushagarwal8720 5 років тому +1

      @@ugururesin8405 Oh! My Bad!
      Thanks for correcting me.

  • @Manu-sz4mo
    @Manu-sz4mo 6 років тому

    Simply AWESOME

    • @LeiosLabs
      @LeiosLabs  6 років тому

      Yeah, batman took a while...

  • @karimaelouahmani7078
    @karimaelouahmani7078 3 роки тому

    i am soooo thankful

  • @walidwalid9991
    @walidwalid9991 7 років тому +1

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

  • @kartiktv007
    @kartiktv007 8 років тому +6

    Awesome video!! Thank you for posting. Harvard MIT should have you as teacher...quant education will be lot more enjoyable!!

    • @LeiosLabs
      @LeiosLabs  8 років тому +3

      I'm still a few years off of my PhD. I'd love to be a professor at some point, though!