{"id":47,"date":"2020-01-29T20:04:08","date_gmt":"2020-01-29T20:04:08","guid":{"rendered":"http:\/\/mathfun4kids.com\/mlog\/?p=47"},"modified":"2020-10-13T16:21:37","modified_gmt":"2020-10-13T16:21:37","slug":"crazy-jumping-frog","status":"publish","type":"post","link":"https:\/\/mathfun4kids.com\/mlog\/?p=47","title":{"rendered":"Crazy Jumping Frog"},"content":{"rendered":"\n<img align=\"right\" src=\"wp-content\/uploads\/2020\/10\/Screen-Shot-2020-01-28-at-5.46.30-PM.png\" alt=\"Crazy Junping Frog\" style=\"margin-left:4px\" class=\"wp-image-49\" width=\"125\" srcset=\"https:\/\/mathfun4kids.com\/mlog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-01-28-at-5.46.30-PM.png 334w, https:\/\/mathfun4kids.com\/mlog\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-01-28-at-5.46.30-PM-300x225.png 300w\" sizes=\"(max-width: 334px) 100vw, 334px\" \/>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<p>Crazy Jumping Frog can jump forward at a distance either 1 foot or 2 feet. The probability it jumps 1 foot forward is $p$, and the probability it jumps 2 feet is $1-p$.  Assume that each jump is independent and the frog has infinite amount of energy \ud83d\ude42<\/p>\n<ol>\n<li>What the expected distance after the frog making $n$ jumps?<\/li>\n<li>If there is an uncovered well $n$ feet away from the frog, what is the probability that the frog fells into the well if it jumps forward trying to pass the well?<\/li>\n<\/ol>\n<p><a onclick=\"toggle_visibility('frazy-frog-solution');\">Click here for the solutions.<\/a><\/p>\n<div id=\"frazy-frog-solution\" style=\"display:none\">\n<p><strong>Solution for Question 1<\/strong> The expected distance in feet for making $1$ jump is $$1\\cdot p + 2\\cdot (1-p)=2-p$$ Since each jump is independent, therefore, the expect distance after the frog making $n$ jumps is $n(2-p)$ feet.<\/p>\n<p><strong>Solution for Question 2<\/strong> Denote the probability of the frog jumping $n$ feet is $f(n)$, we have $$f(n)=p\\cdot f(n-1) + (1-p)\\cdot f(n-2)\\tag{1}$$ with initial values as $$f(0)=1$$ $$f(1)=p$$ $$f(2)=p\\cdot f(1) + (1-p)\\cdot f(0)=p^2-p+1$$<br>\nTo solve (1), which is a <a href=\"http:\/\/discrete.openmathbooks.org\/dmoi2\/sec_recurrence.html\" target=\"_blank\" rel=\"noopener noreferrer\">Recurrence Relation<\/a>, we need to find the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Recurrence_relation#Roots_of_the_characteristic_polynomial\" target=\"_blank\" rel=\"noopener noreferrer\">roots of its characteristic equation<\/a> as the following: $$x^2=px+(1-p)$$\nSolve the above equation, we have\n$$x_{1}=1, x_{2}=p-1$$\nTherefore\n$$f(n)=c_{1}x_{1}^n+c_{2}x_{2}^n=c_{1}+c_{2}(p-1)^n$$\nBecause $f(0)=1$, $f(1)=p$, we have $$\n\\begin{array}{lcc@}\nc_{1} + c_{2}            &amp; = &amp; 1\\\\\nc_{1} + c_{2}\\cdot (p-1) &amp; = &amp; p\n\\end{array}\n$$\nSolve the above linear equations, we have\n$$c_{1}=\\frac{1}{2-p}, \\ \\ \\ \\ c_{2}=\\frac{1-p}{2-p}$$\nTherefore\n$$f(n)=c_{1}+c_{2}(p-1)^n=\\frac{1}{2-p}+\\frac{1-p}{2-p}(p-1)^n=\\frac{1-(p-1)^{n+1}}{2-p}$$\n<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\"><\/div><\/div>\n\n\n\n<p><\/p>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false},"categories":[13,8],"tags":[],"_links":{"self":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=47"}],"version-history":[{"count":17,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions"}],"predecessor-version":[{"id":4789,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=\/wp\/v2\/posts\/47\/revisions\/4789"}],"wp:attachment":[{"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mathfun4kids.com\/mlog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}