{"id":2853,"date":"2025-02-14T02:49:33","date_gmt":"2025-02-14T02:49:33","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=2853"},"modified":"2025-02-14T02:49:35","modified_gmt":"2025-02-14T02:49:35","slug":"monte-carlo-optimisation","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2025\/02\/14\/monte-carlo-optimisation\/","title":{"rendered":"Monte Carlo Optimisation"},"content":{"rendered":"\n<figure class=\"wp-block-image size-medium is-style-rounded\"><img fetchpriority=\"high\" decoding=\"async\" width=\"300\" height=\"300\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/montecarlo-300x300.png\" alt=\"\" class=\"wp-image-2854\" style=\"aspect-ratio:3\/2;object-fit:cover\" srcset=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/montecarlo-150x150@2x.png 300w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/montecarlo-150x150.png 150w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/montecarlo.png 640w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/montecarlo-300x300@2x.png 600w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p>Imagine you&#8217;re trying to find the best solution to a problem, but the problem is really complex and has a lot of randomness involved. Maybe you&#8217;re trying to design a new drug, or optimize a financial portfolio, or figure out the best route for a delivery truck.<\/p>\n\n\n\n<p>Monte Carlo optimization is a technique that uses random sampling to find the best solution.<sup><\/sup> It&#8217;s like throwing darts at a target \u2013 you might not hit the bullseye every time, but if you throw enough darts, you&#8217;ll probably get pretty close. &nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How it Relates to Bernoulli and Binomial<\/strong><\/h2>\n\n\n\n<p>Here&#8217;s where the connection comes in:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Bernoulli Trials:<\/strong> Many optimization problems involve making decisions that have a binary outcome (yes\/no, success\/failure). For example:\n<ul class=\"wp-block-list\">\n<li>Should I invest in this stock? (yes\/no)<\/li>\n\n\n\n<li>Should I use this drug in the clinical trial? (yes\/no)<\/li>\n\n\n\n<li>Should I take this route for the delivery? (yes\/no)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>Each of these decisions can be seen as a Bernoulli trial \u2013 it has two possible outcomes.<sup><\/sup> &nbsp;<\/p>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li><strong>Binomial Distribution:<\/strong> Now, let&#8217;s say you have to make many of these decisions. You might want to know:\n<ul class=\"wp-block-list\">\n<li>What&#8217;s the probability of making at least 7 out of 10 successful investments?<\/li>\n\n\n\n<li>What&#8217;s the probability that the drug will be effective in at least 80% of patients?<\/li>\n\n\n\n<li>What&#8217;s the probability that the delivery truck will arrive on time on at least 90% of its trips?<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>The binomial distribution can help you calculate these probabilities.<sup><\/sup> It tells you the likelihood of getting a certain number of &#8220;successes&#8221; in a series of Bernoulli trials. &nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Putting it Together<\/strong><\/h2>\n\n\n\n<p>In Monte Carlo optimization, you might use the binomial distribution to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Evaluate potential solutions:<\/strong> You could simulate different scenarios by randomly making decisions (Bernoulli trials) and then use the binomial distribution to assess how likely it is that a particular solution will achieve a desired outcome.<\/li>\n\n\n\n<li><strong>Guide the search for better solutions:<\/strong> By understanding the probabilities associated with different decisions, you can guide your search towards solutions that are more likely to be successful.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example<\/strong><\/h2>\n\n\n\n<p>Let&#8217;s say you&#8217;re designing a new online advertising campaign. You have different ad formats and targeting strategies, and you want to find the combination that maximizes click-through rates.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Bernoulli Trials:<\/strong> Each time a user sees an ad, it&#8217;s a Bernoulli trial \u2013 they either click on it (success) or they don&#8217;t (failure).<\/li>\n\n\n\n<li><strong>Binomial Distribution:<\/strong> You can use the binomial distribution to estimate the probability of getting a certain number of clicks for a given ad format and targeting strategy.<\/li>\n\n\n\n<li><strong>Monte Carlo Optimization:<\/strong> You can run many simulations, trying different combinations of ad formats and targeting strategies, and use the binomial distribution to evaluate the performance of each combination. This helps you find the combination that is most likely to result in high click-through rates.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>In Layman&#8217;s Terms<\/strong><\/h2>\n\n\n\n<p>Imagine you&#8217;re trying to find the best recipe for a cake. You have different ingredients and baking times, and you want to find the combination that makes the tastiest cake.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Bernoulli Trials:<\/strong> Each time you try a different ingredient or baking time, it&#8217;s like a Bernoulli trial \u2013 the cake either tastes good (success) or it doesn&#8217;t (failure).<\/li>\n\n\n\n<li><strong>Binomial Distribution:<\/strong> You can use the binomial distribution to estimate how likely it is that a certain combination of ingredients and baking times will result in a tasty cake.<\/li>\n\n\n\n<li><strong>Monte Carlo Optimization:<\/strong> You can bake many cakes, trying different combinations of ingredients and baking times, and use the binomial distribution to evaluate how tasty each cake is. This helps you find the recipe that is most likely to make the tastiest cake.<\/li>\n<\/ul>\n\n\n\n<p>Essentially, Monte Carlo optimization uses the principles of Bernoulli trials and the binomial distribution to explore a range of possibilities and find the best solution in problems where there&#8217;s a lot of uncertainty<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine you&#8217;re trying to find the best solution to a problem, but the problem is really complex and has a lot of randomness involved. Maybe you&#8217;re trying to design a new drug, or optimize a financial portfolio, or figure out the best route for a delivery truck. Monte Carlo optimization is a technique that uses [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2855,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[34],"tags":[330,338],"class_list":["post-2853","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical","tag-ba","tag-mc"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2853","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=2853"}],"version-history":[{"count":1,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2853\/revisions"}],"predecessor-version":[{"id":2856,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2853\/revisions\/2856"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/2855"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=2853"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=2853"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=2853"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}