# Bad mouse, good mouse [closed]

In a certain city, there are only two companies (called Company A and Company B), that manufacture computer mice.

The computer mice from Company A last $x$ hours before needing to be recharged, while the computer mice from Company B last $y$ hours before needing to be recharged.

$a$% of the computer mice in this city are made by Company A, and all the rest are made by Company B.

What is the expected length of time that a randomly purchased, completely unlabeled (thus of an unknown manufacturer) computer mouse will last for before recharging, assuming it is purchased from the local electronics store within this city, and assuming the store sells only computer mice from these two companies, and nothing else?

## closed as off-topic by Jonathan Allan, Dan Russell, Sconibulus, Deusovi♦Nov 8 '16 at 3:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is off-topic as it appears to be a mathematics problem, as opposed to a mathematical puzzle. For more info, see "Are math-textbook-style problems on topic?" on meta." – Jonathan Allan, Dan Russell, Sconibulus, Deusovi
If this question can be reworded to fit the rules in the help center, please edit the question.

• Are you sure this qualifies for the story tag? – greenturtle3141 Nov 8 '16 at 0:57
• Also, doesn't this heavily depend on the total number of mice? – greenturtle3141 Nov 8 '16 at 0:59
• Looks to me like a mathematics problem, not a puzzle. – Jonathan Allan Nov 8 '16 at 1:27
• @CipherRiddle: This can be solved with elementary mathematics. There is no "sudden insight" or "flash of inspiration" that characterizes any puzzle, which is why I do not feel hesitant in my voting to close. – Deusovi Nov 8 '16 at 3:42

Seems like it would be

$\frac{a}{100}x+(1-\frac{a}{100})y$

If $a$% of the mice are made by Company A, then there is a $\frac{a}{100}$ probability that a randomly selected mouse was made by Company A, and a $(1-\frac{a}{100})$ probability that it was made by Company B.  Expected value is probability times value, so this expected value is \begin{align}&P(\text{mouse was made by }\textit{Company A})\times(\text{duration of }\textit{Company A}\text{ mice})\\&~~~~+P(\text{mouse was made by }\textit{Company B})\times(\text{duration of }\textit{Company B}\text{ mice})\end{align}

As an image:

which is the formula I gave above.

• Works for me in both IE and Firefox. And seriously?  You think taking a hatchet to my answer five minutes after asking me to change it is appropriate? – Peregrine Rook Nov 8 '16 at 1:56
• No, I didn’t take the total number of computer mice into account.  Oh my gosh, that changes everything!  My answer is incomplete!  I didn’t state that, if the total number of computer mice is zero, then the expected length of time that a randomly purchased, completely unlabeled computer mouse will last for before recharging is undefined! Otherwise, multiply the answer I gave by n / n, for any non-zero value of n — i.e., it doesn’t matter.     :-)     ⁠ – Peregrine Rook Nov 8 '16 at 2:33
• @CipherRiddle    :-)   ⁠ – Peregrine Rook Nov 8 '16 at 3:04