Expectation of a battery lifetime: Uniform Distributions











up vote
0
down vote

favorite












Question:



A battery has a lifetime of $24$ hours and it is used for maximum three days. On each day, a person uses the battery for $K$ hours, where $K$ is uniform on $[0,24]$ and independent of the other days. What is the expectation of the remaining lifetime at the end of the third day?



My work:



Let $X$, $Y$, $Z$ as the amount of battery lifetime used on each day, respectively. Then the amount of battery lifetime left at the third day would be as follows:



$W=$ $[(24-X)/24]$ * $[(24-X-Y)/24]$ * $(24-X-Y-Z)$



Since at the second day, for a probability of $X/24$, the remaining lifetime would be $0$, and else (for a probability of $(24-X)/24$), there would be $(24-X-Y)$ left. I did the same for the third day.



Then I computed $E[W]$, which seemed to be $4$, but the correct answer seems to be $1$ (hour).



I think $W$ is miscalculated, because I checked the rest a couple times. Can anyone tell me what is wrong?





(Edit) If it is simplified into a two-day process, I thought it can be calculated as the following:



Let $W$ the amount of lifetime left at the end of the second day. If $X$ is used on the first day, there is a $(X/24)$ probability that the battery will be used up on the second day. On the other hand, $((24-X)/24)$ is the probability that the used amount of the battery is $(X+Y)$, or $(24-X-Y)$ is the left amount.



Then $W=(X/24)*0+((24-X)/24)*(24-X-Y)$



and



$E[W]= (1/24) * E[(24-X)(24-X-Y)]= (1/24)*(24^2 - 48E[X] - 24E[Y] + E[X^2] + E[XY])$



where



$E[X]=E[Y], E[X^2]=E[XY]$ since $X$ and $Y$ are independent, and $E[X]=12, E[X^2]=192$.



Then we have:



$E[W]=24-2*12-12+16=4$ (hours),



which is the same as the calculation obtained by the integration method.










share|cite|improve this question




























    up vote
    0
    down vote

    favorite












    Question:



    A battery has a lifetime of $24$ hours and it is used for maximum three days. On each day, a person uses the battery for $K$ hours, where $K$ is uniform on $[0,24]$ and independent of the other days. What is the expectation of the remaining lifetime at the end of the third day?



    My work:



    Let $X$, $Y$, $Z$ as the amount of battery lifetime used on each day, respectively. Then the amount of battery lifetime left at the third day would be as follows:



    $W=$ $[(24-X)/24]$ * $[(24-X-Y)/24]$ * $(24-X-Y-Z)$



    Since at the second day, for a probability of $X/24$, the remaining lifetime would be $0$, and else (for a probability of $(24-X)/24$), there would be $(24-X-Y)$ left. I did the same for the third day.



    Then I computed $E[W]$, which seemed to be $4$, but the correct answer seems to be $1$ (hour).



    I think $W$ is miscalculated, because I checked the rest a couple times. Can anyone tell me what is wrong?





    (Edit) If it is simplified into a two-day process, I thought it can be calculated as the following:



    Let $W$ the amount of lifetime left at the end of the second day. If $X$ is used on the first day, there is a $(X/24)$ probability that the battery will be used up on the second day. On the other hand, $((24-X)/24)$ is the probability that the used amount of the battery is $(X+Y)$, or $(24-X-Y)$ is the left amount.



    Then $W=(X/24)*0+((24-X)/24)*(24-X-Y)$



    and



    $E[W]= (1/24) * E[(24-X)(24-X-Y)]= (1/24)*(24^2 - 48E[X] - 24E[Y] + E[X^2] + E[XY])$



    where



    $E[X]=E[Y], E[X^2]=E[XY]$ since $X$ and $Y$ are independent, and $E[X]=12, E[X^2]=192$.



    Then we have:



    $E[W]=24-2*12-12+16=4$ (hours),



    which is the same as the calculation obtained by the integration method.










    share|cite|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Question:



      A battery has a lifetime of $24$ hours and it is used for maximum three days. On each day, a person uses the battery for $K$ hours, where $K$ is uniform on $[0,24]$ and independent of the other days. What is the expectation of the remaining lifetime at the end of the third day?



      My work:



      Let $X$, $Y$, $Z$ as the amount of battery lifetime used on each day, respectively. Then the amount of battery lifetime left at the third day would be as follows:



      $W=$ $[(24-X)/24]$ * $[(24-X-Y)/24]$ * $(24-X-Y-Z)$



      Since at the second day, for a probability of $X/24$, the remaining lifetime would be $0$, and else (for a probability of $(24-X)/24$), there would be $(24-X-Y)$ left. I did the same for the third day.



      Then I computed $E[W]$, which seemed to be $4$, but the correct answer seems to be $1$ (hour).



      I think $W$ is miscalculated, because I checked the rest a couple times. Can anyone tell me what is wrong?





      (Edit) If it is simplified into a two-day process, I thought it can be calculated as the following:



      Let $W$ the amount of lifetime left at the end of the second day. If $X$ is used on the first day, there is a $(X/24)$ probability that the battery will be used up on the second day. On the other hand, $((24-X)/24)$ is the probability that the used amount of the battery is $(X+Y)$, or $(24-X-Y)$ is the left amount.



      Then $W=(X/24)*0+((24-X)/24)*(24-X-Y)$



      and



      $E[W]= (1/24) * E[(24-X)(24-X-Y)]= (1/24)*(24^2 - 48E[X] - 24E[Y] + E[X^2] + E[XY])$



      where



      $E[X]=E[Y], E[X^2]=E[XY]$ since $X$ and $Y$ are independent, and $E[X]=12, E[X^2]=192$.



      Then we have:



      $E[W]=24-2*12-12+16=4$ (hours),



      which is the same as the calculation obtained by the integration method.










      share|cite|improve this question















      Question:



      A battery has a lifetime of $24$ hours and it is used for maximum three days. On each day, a person uses the battery for $K$ hours, where $K$ is uniform on $[0,24]$ and independent of the other days. What is the expectation of the remaining lifetime at the end of the third day?



      My work:



      Let $X$, $Y$, $Z$ as the amount of battery lifetime used on each day, respectively. Then the amount of battery lifetime left at the third day would be as follows:



      $W=$ $[(24-X)/24]$ * $[(24-X-Y)/24]$ * $(24-X-Y-Z)$



      Since at the second day, for a probability of $X/24$, the remaining lifetime would be $0$, and else (for a probability of $(24-X)/24$), there would be $(24-X-Y)$ left. I did the same for the third day.



      Then I computed $E[W]$, which seemed to be $4$, but the correct answer seems to be $1$ (hour).



      I think $W$ is miscalculated, because I checked the rest a couple times. Can anyone tell me what is wrong?





      (Edit) If it is simplified into a two-day process, I thought it can be calculated as the following:



      Let $W$ the amount of lifetime left at the end of the second day. If $X$ is used on the first day, there is a $(X/24)$ probability that the battery will be used up on the second day. On the other hand, $((24-X)/24)$ is the probability that the used amount of the battery is $(X+Y)$, or $(24-X-Y)$ is the left amount.



      Then $W=(X/24)*0+((24-X)/24)*(24-X-Y)$



      and



      $E[W]= (1/24) * E[(24-X)(24-X-Y)]= (1/24)*(24^2 - 48E[X] - 24E[Y] + E[X^2] + E[XY])$



      where



      $E[X]=E[Y], E[X^2]=E[XY]$ since $X$ and $Y$ are independent, and $E[X]=12, E[X^2]=192$.



      Then we have:



      $E[W]=24-2*12-12+16=4$ (hours),



      which is the same as the calculation obtained by the integration method.







      probability uniform-distribution expected-value






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited 20 hours ago

























      asked 22 hours ago









      Richard

      376




      376






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          Don't you just want to integrate $24-x-y-z$ over the region where this is positive? That is, $${1over24^3}int_0^{24}int_0^{24-x}int_0^{24-x-y}(24-x-y-z)dzdydx$$






          share|cite|improve this answer





















          • Got it! Thanks for a straightforward answer. But can you tell which part I missed at my original solution?
            – Richard
            21 hours ago












          • And, can you please explain why you divided by $1/(24^3)$?
            – Richard
            21 hours ago






          • 1




            @Richard Well, to get a uniform probability distribution over $[0,24]$, I have to divide by $24,$ so for a triple integral, I divide by $24^3$. For the average use in a day, for example, we'd compute ${1over24}int_0^{24}xdx=12.$
            – saulspatz
            21 hours ago












          • Gosh, I suddenly forgot the distribution was uniform... Thanks!
            – Richard
            20 hours ago












          • @Richard All I can say about what's wrong is that you seem to be trying to accomplish by multiplication what you need to do by adjusting the limits of integration. Maybe I just don't understand what you're doing, but it simply looks wrong to me. On second thought, maybe you're thinking about the probability that the battery isn't used up, but that's not how to compute the expectation.
            – saulspatz
            20 hours ago




















          up vote
          0
          down vote













          Just an addendum to saulspatz's answer, in which for convenience I'll change time units to days so every $24$ becomes a $1$: if the battery is used for uniformly distributed time periods on each of $n$ days, the fraction of its lifetime remaining is $frac{1}{(n+1)!}$, which in the $n=3$ case considered herein becomes $frac{1}{24}$, i.e. an hour as required. But where did I get this formula from?



          We wish to evaluate $int_{P_n}(1-sum_{i=1}^n x_i)d^n x$, where $P_n$ is the region $x_ige 0,,sum_i x_ile 1$. With the substitution $x_i=sin^2 t_icdot prod_{j<i}cos^2 t_j$, the Jacobian is $2^nprod_i sin t_i cos^{2n+1-2i}t_i$, and $1-sum_i x_i=prod_icos^2t_i$. The integral becomes $$2^nprod_iint_0^{pi/2}sinthetacos^{2n+3-2i}theta dtheta=2^nprod_ifrac{1}{2n+4-2i}=prod_ifrac{1}{n+2-i}=frac{1}{(n+1)!}.$$






          share|cite|improve this answer





















            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "69"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3004842%2fexpectation-of-a-battery-lifetime-uniform-distributions%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            Don't you just want to integrate $24-x-y-z$ over the region where this is positive? That is, $${1over24^3}int_0^{24}int_0^{24-x}int_0^{24-x-y}(24-x-y-z)dzdydx$$






            share|cite|improve this answer





















            • Got it! Thanks for a straightforward answer. But can you tell which part I missed at my original solution?
              – Richard
              21 hours ago












            • And, can you please explain why you divided by $1/(24^3)$?
              – Richard
              21 hours ago






            • 1




              @Richard Well, to get a uniform probability distribution over $[0,24]$, I have to divide by $24,$ so for a triple integral, I divide by $24^3$. For the average use in a day, for example, we'd compute ${1over24}int_0^{24}xdx=12.$
              – saulspatz
              21 hours ago












            • Gosh, I suddenly forgot the distribution was uniform... Thanks!
              – Richard
              20 hours ago












            • @Richard All I can say about what's wrong is that you seem to be trying to accomplish by multiplication what you need to do by adjusting the limits of integration. Maybe I just don't understand what you're doing, but it simply looks wrong to me. On second thought, maybe you're thinking about the probability that the battery isn't used up, but that's not how to compute the expectation.
              – saulspatz
              20 hours ago

















            up vote
            1
            down vote



            accepted










            Don't you just want to integrate $24-x-y-z$ over the region where this is positive? That is, $${1over24^3}int_0^{24}int_0^{24-x}int_0^{24-x-y}(24-x-y-z)dzdydx$$






            share|cite|improve this answer





















            • Got it! Thanks for a straightforward answer. But can you tell which part I missed at my original solution?
              – Richard
              21 hours ago












            • And, can you please explain why you divided by $1/(24^3)$?
              – Richard
              21 hours ago






            • 1




              @Richard Well, to get a uniform probability distribution over $[0,24]$, I have to divide by $24,$ so for a triple integral, I divide by $24^3$. For the average use in a day, for example, we'd compute ${1over24}int_0^{24}xdx=12.$
              – saulspatz
              21 hours ago












            • Gosh, I suddenly forgot the distribution was uniform... Thanks!
              – Richard
              20 hours ago












            • @Richard All I can say about what's wrong is that you seem to be trying to accomplish by multiplication what you need to do by adjusting the limits of integration. Maybe I just don't understand what you're doing, but it simply looks wrong to me. On second thought, maybe you're thinking about the probability that the battery isn't used up, but that's not how to compute the expectation.
              – saulspatz
              20 hours ago















            up vote
            1
            down vote



            accepted







            up vote
            1
            down vote



            accepted






            Don't you just want to integrate $24-x-y-z$ over the region where this is positive? That is, $${1over24^3}int_0^{24}int_0^{24-x}int_0^{24-x-y}(24-x-y-z)dzdydx$$






            share|cite|improve this answer












            Don't you just want to integrate $24-x-y-z$ over the region where this is positive? That is, $${1over24^3}int_0^{24}int_0^{24-x}int_0^{24-x-y}(24-x-y-z)dzdydx$$







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered 21 hours ago









            saulspatz

            12.8k21327




            12.8k21327












            • Got it! Thanks for a straightforward answer. But can you tell which part I missed at my original solution?
              – Richard
              21 hours ago












            • And, can you please explain why you divided by $1/(24^3)$?
              – Richard
              21 hours ago






            • 1




              @Richard Well, to get a uniform probability distribution over $[0,24]$, I have to divide by $24,$ so for a triple integral, I divide by $24^3$. For the average use in a day, for example, we'd compute ${1over24}int_0^{24}xdx=12.$
              – saulspatz
              21 hours ago












            • Gosh, I suddenly forgot the distribution was uniform... Thanks!
              – Richard
              20 hours ago












            • @Richard All I can say about what's wrong is that you seem to be trying to accomplish by multiplication what you need to do by adjusting the limits of integration. Maybe I just don't understand what you're doing, but it simply looks wrong to me. On second thought, maybe you're thinking about the probability that the battery isn't used up, but that's not how to compute the expectation.
              – saulspatz
              20 hours ago




















            • Got it! Thanks for a straightforward answer. But can you tell which part I missed at my original solution?
              – Richard
              21 hours ago












            • And, can you please explain why you divided by $1/(24^3)$?
              – Richard
              21 hours ago






            • 1




              @Richard Well, to get a uniform probability distribution over $[0,24]$, I have to divide by $24,$ so for a triple integral, I divide by $24^3$. For the average use in a day, for example, we'd compute ${1over24}int_0^{24}xdx=12.$
              – saulspatz
              21 hours ago












            • Gosh, I suddenly forgot the distribution was uniform... Thanks!
              – Richard
              20 hours ago












            • @Richard All I can say about what's wrong is that you seem to be trying to accomplish by multiplication what you need to do by adjusting the limits of integration. Maybe I just don't understand what you're doing, but it simply looks wrong to me. On second thought, maybe you're thinking about the probability that the battery isn't used up, but that's not how to compute the expectation.
              – saulspatz
              20 hours ago


















            Got it! Thanks for a straightforward answer. But can you tell which part I missed at my original solution?
            – Richard
            21 hours ago






            Got it! Thanks for a straightforward answer. But can you tell which part I missed at my original solution?
            – Richard
            21 hours ago














            And, can you please explain why you divided by $1/(24^3)$?
            – Richard
            21 hours ago




            And, can you please explain why you divided by $1/(24^3)$?
            – Richard
            21 hours ago




            1




            1




            @Richard Well, to get a uniform probability distribution over $[0,24]$, I have to divide by $24,$ so for a triple integral, I divide by $24^3$. For the average use in a day, for example, we'd compute ${1over24}int_0^{24}xdx=12.$
            – saulspatz
            21 hours ago






            @Richard Well, to get a uniform probability distribution over $[0,24]$, I have to divide by $24,$ so for a triple integral, I divide by $24^3$. For the average use in a day, for example, we'd compute ${1over24}int_0^{24}xdx=12.$
            – saulspatz
            21 hours ago














            Gosh, I suddenly forgot the distribution was uniform... Thanks!
            – Richard
            20 hours ago






            Gosh, I suddenly forgot the distribution was uniform... Thanks!
            – Richard
            20 hours ago














            @Richard All I can say about what's wrong is that you seem to be trying to accomplish by multiplication what you need to do by adjusting the limits of integration. Maybe I just don't understand what you're doing, but it simply looks wrong to me. On second thought, maybe you're thinking about the probability that the battery isn't used up, but that's not how to compute the expectation.
            – saulspatz
            20 hours ago






            @Richard All I can say about what's wrong is that you seem to be trying to accomplish by multiplication what you need to do by adjusting the limits of integration. Maybe I just don't understand what you're doing, but it simply looks wrong to me. On second thought, maybe you're thinking about the probability that the battery isn't used up, but that's not how to compute the expectation.
            – saulspatz
            20 hours ago












            up vote
            0
            down vote













            Just an addendum to saulspatz's answer, in which for convenience I'll change time units to days so every $24$ becomes a $1$: if the battery is used for uniformly distributed time periods on each of $n$ days, the fraction of its lifetime remaining is $frac{1}{(n+1)!}$, which in the $n=3$ case considered herein becomes $frac{1}{24}$, i.e. an hour as required. But where did I get this formula from?



            We wish to evaluate $int_{P_n}(1-sum_{i=1}^n x_i)d^n x$, where $P_n$ is the region $x_ige 0,,sum_i x_ile 1$. With the substitution $x_i=sin^2 t_icdot prod_{j<i}cos^2 t_j$, the Jacobian is $2^nprod_i sin t_i cos^{2n+1-2i}t_i$, and $1-sum_i x_i=prod_icos^2t_i$. The integral becomes $$2^nprod_iint_0^{pi/2}sinthetacos^{2n+3-2i}theta dtheta=2^nprod_ifrac{1}{2n+4-2i}=prod_ifrac{1}{n+2-i}=frac{1}{(n+1)!}.$$






            share|cite|improve this answer

























              up vote
              0
              down vote













              Just an addendum to saulspatz's answer, in which for convenience I'll change time units to days so every $24$ becomes a $1$: if the battery is used for uniformly distributed time periods on each of $n$ days, the fraction of its lifetime remaining is $frac{1}{(n+1)!}$, which in the $n=3$ case considered herein becomes $frac{1}{24}$, i.e. an hour as required. But where did I get this formula from?



              We wish to evaluate $int_{P_n}(1-sum_{i=1}^n x_i)d^n x$, where $P_n$ is the region $x_ige 0,,sum_i x_ile 1$. With the substitution $x_i=sin^2 t_icdot prod_{j<i}cos^2 t_j$, the Jacobian is $2^nprod_i sin t_i cos^{2n+1-2i}t_i$, and $1-sum_i x_i=prod_icos^2t_i$. The integral becomes $$2^nprod_iint_0^{pi/2}sinthetacos^{2n+3-2i}theta dtheta=2^nprod_ifrac{1}{2n+4-2i}=prod_ifrac{1}{n+2-i}=frac{1}{(n+1)!}.$$






              share|cite|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Just an addendum to saulspatz's answer, in which for convenience I'll change time units to days so every $24$ becomes a $1$: if the battery is used for uniformly distributed time periods on each of $n$ days, the fraction of its lifetime remaining is $frac{1}{(n+1)!}$, which in the $n=3$ case considered herein becomes $frac{1}{24}$, i.e. an hour as required. But where did I get this formula from?



                We wish to evaluate $int_{P_n}(1-sum_{i=1}^n x_i)d^n x$, where $P_n$ is the region $x_ige 0,,sum_i x_ile 1$. With the substitution $x_i=sin^2 t_icdot prod_{j<i}cos^2 t_j$, the Jacobian is $2^nprod_i sin t_i cos^{2n+1-2i}t_i$, and $1-sum_i x_i=prod_icos^2t_i$. The integral becomes $$2^nprod_iint_0^{pi/2}sinthetacos^{2n+3-2i}theta dtheta=2^nprod_ifrac{1}{2n+4-2i}=prod_ifrac{1}{n+2-i}=frac{1}{(n+1)!}.$$






                share|cite|improve this answer












                Just an addendum to saulspatz's answer, in which for convenience I'll change time units to days so every $24$ becomes a $1$: if the battery is used for uniformly distributed time periods on each of $n$ days, the fraction of its lifetime remaining is $frac{1}{(n+1)!}$, which in the $n=3$ case considered herein becomes $frac{1}{24}$, i.e. an hour as required. But where did I get this formula from?



                We wish to evaluate $int_{P_n}(1-sum_{i=1}^n x_i)d^n x$, where $P_n$ is the region $x_ige 0,,sum_i x_ile 1$. With the substitution $x_i=sin^2 t_icdot prod_{j<i}cos^2 t_j$, the Jacobian is $2^nprod_i sin t_i cos^{2n+1-2i}t_i$, and $1-sum_i x_i=prod_icos^2t_i$. The integral becomes $$2^nprod_iint_0^{pi/2}sinthetacos^{2n+3-2i}theta dtheta=2^nprod_ifrac{1}{2n+4-2i}=prod_ifrac{1}{n+2-i}=frac{1}{(n+1)!}.$$







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered 19 hours ago









                J.G.

                18.1k11830




                18.1k11830






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3004842%2fexpectation-of-a-battery-lifetime-uniform-distributions%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                    SQL update select statement

                    'app-layout' is not a known element: how to share Component with different Modules