Wikipedia:Reference desk/Archives/Mathematics/2011 November 18

= November 18 =

Probability and boolean events
Suppose you want to buy a toy for your daughter and you want to make sure she will like it. To make sure she'll like it, you decide to ask her friends (for this problem you can imagine she has infinity friends). Each friend, independently, can tell you whether she will like it or not correctly with probability 2/3 (each friend gives a boolean answer though).

How can you find out your daughter will like the toy you are about to buy with probability >= 1 - 2^(1/n) where n is the number of friends you will ask? — Preceding unsigned comment added by Rain titan (talk • contribs) 04:39, 18 November 2011 (UTC)


 * First, I think you meant 1 - (1/2)^n. 1 - 2^(1/n) is always negative.  Assuming you did, this is called probability amplification.  Short answer: choose k bigger than $$n / \log_2 (9/8)$$, and ask 2k friends.  If more than half say yes, assume she likes it.  Otherwise, assume she doesn't.


 * Justification: if you made the wrong decision, then at most half her friends gave the right answer. The odds of this happening is $$\sum_{i = 0}^k {2k \choose i} (2/3)^i (1/3)^{2k-i} \leq \sum_{i = 0}^k {2k \choose i} (2/3)^k(1/3)^k \leq (2/9)^k \sum_{i=0}^k {2k \choose i} \leq (2/9)^k 2^{2k} = (2/9)^k 4^k = (8/9)^k$$.


 * So you need $$(8/9)^k < 2^{-n}$$ So $$k \log_2 (8/9) < -n$$, and thus $$k > n/ \log_2 (9/8)$$.--121.74.125.249 (talk) 05:42, 18 November 2011 (UTC)


 * Just noticed you specified that you can only ask n friends. In that case, it's not possible.  The best you can possibly do is majority vote, and your certainty doesn't increase that fast.  For example, with three friends, you only have probability (20/27) of making the right choice.--121.74.125.249 (talk) 05:48, 18 November 2011 (UTC)
 * This is a frequentist solution. For a Bayesian solution You need to know the prior probability. If A = "Your daughter likes it" and D = "m out of n friends asked says she likes it", then
 * $$\mathrm{Pr}(A|D)=\frac{\mathrm{Pr}(A)\mathrm{Pr}(D|A)}{\mathrm{Pr}(D)}=\frac{\mathrm{Pr}(A)\binom{n}{m}(2/3)^m(1/3)^{n-m}}{\mathrm{Pr}(A)\binom{n}{m}(2/3)^m(1/3)^{n-m}+(1-\mathrm{Pr}(A))\binom{n}{m}(1/3)^m(2/3)^{n-m}}=\frac{1}{1+\frac{1-\mathrm{Pr}(A)}{\mathrm{Pr}(A)}2^{n-2m}}$$
 * If we assume for simplicity that $$\mathrm{Pr}(A)=1/2$$ and that m is high, then this is roughly $$1-2^{n-2m}$$. So only in the highly unlikely case that everyone says yes you'll have $$1-2^{-n}$$ confidence.
 * This could have been solved more simply by considering odds ratios. Every friend who says yes multiplies the odds ratio by 2, every one who says no divides it by 2. -- Meni Rosenfeld (talk) 08:31, 18 November 2011 (UTC)

Euler's Identity Question
Just a quick question, something I don't understand about Euler's identity.

Why does

$$e^{i \pi} = -1\!$$

when

$$e^{i \pi} = e^{(\pi \times i)} = e^{3.1415 i} = 23.1406926{i}\!$$?

174.93.63.116 (talk) 15:53, 18 November 2011 (UTC)


 * It comes from the identity $$e^{i \theta} = \cos(\theta)+i\sin(\theta)$$. Plug in $$\theta = \pi$$ and you get the desired result. Readro (talk) 16:06, 18 November 2011 (UTC)


 * How do you get to 23.1406926i ? By playing fast and loose with re-arrangements of infinite series we can informally "prove" Euler's identity as follows:


 * $$e^{i \pi} = 1 + (i \pi) + \frac{(i \pi)^2}{2!} + \frac{(i \pi)^3}{3!} + \frac{(i \pi)^4}{4!} + \frac{(i \pi)^5}{5!} \dots$$
 * $$= (1 - \frac{\pi^2}{2!} + \frac{\pi^4}{4!} \dots) + i(\pi - \frac{\pi^3}{3!} + \frac{\pi^5}{5!} \dots)$$
 * $$= \cos(\pi) + i\sin(\pi) = -1$$
 * Gandalf61 (talk) 16:07, 18 November 2011 (UTC)


 * $$e^{i \pi}$$ ≈ $${23.1406926}^{i}$$, not $$23.1406926{i}$$. At this point in the calculation there is no reason to believe that the right-hand side is not equal to -1. If you want to go this route you have to keep working on the right-hand side until it has the form $$a + bi$$. 98.248.42.252 (talk) 16:24, 18 November 2011 (UTC)

The error is that $$e^{3.1415 i} = 23.1406926^i$$, not $$23.1406926{i}$$. Looie496 (talk) 16:28, 18 November 2011 (UTC)

Probability of certain factors existing
Hi, is there any way of estimating the probability that a randomly chosen n-digit number will have at least one factor whose length is between p and q digits? Assume n is sufficiently large. 81.159.104.115 (talk) 21:00, 18 November 2011 (UTC)


 * The expected number of factors between $$10^p$$ and $$10^q$$ doesn't depend on $$n$$ (as long as $$n$$ is sufficiently large) and is
 * $$\sum_{k=10^p}^{10^q} 1/k$$ ≈ $$\ln(10^q) - \ln(10^p)$$ = $$(q-p) \ln(10)$$.
 * The expected number of prime factors between $$10^p$$ and $$10^q$$ is
 * $$\sum_{k=10^p}^{10^q} 1/(k \ln k)$$ ≈ $$\ln(\ln(10^q)) - \ln(\ln(10^p))$$ = $$\ln(q/p)$$.
 * You asked for a probability, not the expected value. Assuming that $$n$$ is sufficiently large, the number of prime factors between $$10^p$$ and $$10^q$$ should follow a Poisson distribution, so the probability of having at least one prime factor between $$10^p$$ and $$10^q$$ is $$1 - e^{-\ln(q/p)}$$ = $$1 - p/q$$. For the probability with composite factors allowed, I don't know. The number of factors doesn't follow a Poisson distribution because the events are not very independent. I don't know what distribution it follows so I'll let someone else take it from here. 98.248.42.252 (talk) 07:03, 19 November 2011 (UTC)

Power series for arcsine
What's a relatively straightforward way to find a power series for arcsin(x)? I'm stumped! — Trevor K. — 21:49, 18 November 2011 (UTC)  — Preceding unsigned comment added by Yakeyglee (talk • contribs)


 * This may be a bit dodgy, but how about:

\arcsin(x) = \int_0^x \frac{dy}{\sqrt{1-y^2}} $$
 * I'm not sure what happens when $$x= \pm 1$$, as arsin(x) is defined but this integral isn't? Given that |x|<1 we can use the Maclaurin series for the square root (from Taylor_series:
 * $$(1+x)^{-1/2} = \sum_{n=0}^\infty {-\frac{1}{2} \choose n} x^n

\text{ for }|x|\le1$$

\arcsin(x) = \int_0^x dy \sum_{n=0}^\infty {-\frac{1}{2} \choose n} (-y^2)^n $$

\arcsin(x) = \sum_{n=0}^\infty {-\frac{1}{2} \choose n} (-1)^{2n} \frac{1}{2n+1}x^{2n+1} $$


 * (I think) Not very straightforward though... 77.86.108.27 (talk) 22:33, 18 November 2011 (UTC)
 * Impressive! I like it!  It's reminiscent of the polynomial expansion of the Lorentz Factor from special relativity!  I am satisfied! :P   — Trevor K. —  22:45, 18 November 2011 (UTC)  — Preceding unsigned comment added by Yakeyglee (talk • contribs)
 * The integral exists for $$x= \pm 1$$, see Improper integral. -- Meni Rosenfeld (talk) 16:55, 19 November 2011 (UTC)
 * The Lagrange inversion theorem is relevant. -- Meni Rosenfeld (talk) 16:55, 19 November 2011 (UTC)