Given a coin with probability p of landing on heads after a flip, what is the probability that the number of heads will ever equal the number of tails assuming an infinite number of flips?

Printable View

- Feb 2nd 2006, 11:03 PMyiyayiyayohelp plz...
Given a coin with probability p of landing on heads after a flip, what is the probability that the number of heads will ever equal the number of tails assuming an infinite number of flips?

- Feb 2nd 2006, 11:27 PMyiyayiyayoanother one
Some integers can be expressed as the sum of two or more consecutive positive integers. For example, 17 = 8+9, 24 = 7+8+9. Other integers, such as 8, cannot be expressed that way. Which integers can be expressed as a sum of two or more consecutive positive integers, and which cannot? See if you can prove your answer.

- Feb 3rd 2006, 02:02 AMCaptainBlackQuote:

Originally Posted by**yiyayiyayo**

like, what is the probability that at some time in this sequece of flips we

have the number of heads so far equals the number of tails so far?

RonL - Feb 3rd 2006, 02:11 AMyiyayiyayo
The answer is 2*min(p,1-p).

Could you tell me how to do it?

Thank you. - Feb 3rd 2006, 09:12 AMThePerfectHackerQuote:

Originally Posted by**yiyayiyayo**

Now observe the following:

**Those expressed as 2 consecutives:**

$\displaystyle n+(n+1)=2n+1$

**Those expressed as 3 consecutives:**

$\displaystyle n+(n+1)+(n+2)=3n+3$

.................................................. .....

**Those expressed as $\displaystyle k$ consecutives:**

$\displaystyle \sum^{k-1}_{j=0}(n+j)=kn+\frac{k(k-1)}{2}$.

Thus, a number $\displaystyle m$ has the form of

$\displaystyle m=kn+\frac{k(k-1)}{2}$ if and only if it can be expressed as consectutives. (Although the converse part was omitted in the proof, I assume you see it).

Thus the answer to your question is the above statement. To put it more elegantly:

If the Diophantine equation

$\displaystyle 2m=2kn+k(k-1)=k(2n+k-1)$

has a solution for a given $\displaystyle m$ for certain $\displaystyle k,n$ if and only if $\displaystyle m$ can be expressed as consecutives.

Q.E.D.

I am trying to see if I can simplify what I just said. I think it might be brought to the Pellian equation, but that needs some work. If I find a way I will respond back. - Feb 3rd 2006, 09:23 AMThePerfectHackerQuote:

Originally Posted by**yiyayiyayo**

Let me explain why the infinity part gives me confusion. Let $\displaystyle f(x)=\left\{\begin{array}{cc}P(x)&\mbox {if even}\\0&\mbox{if odd}\end{array}\right$

Where $\displaystyle P(x)$ is the probability of getting for same head and tails for even amount of throws which as said above exists. Now when you say infinity I understand that as,

$\displaystyle \lim_{x\to \infty}f(x)=?$, I believe it diverges by osicallation, does it not? - Feb 3rd 2006, 09:36 AMCaptainBlackQuote:

Originally Posted by**yiyayiyayo**

maths. Are you sure that you don't already have a short cut for this problem

in your notes or textbook?

Also its a lot of typing, I will start typing the solution in about 3 hours.

RonL - Feb 3rd 2006, 09:44 AMThePerfectHacker
I am guessing that this has something to do with the Strong Law of Large numbers. Because if it was a fair coin, $\displaystyle p=1/2$ then, as you increase the number of throws by the Strong Law of Large Numbers is $\displaystyle 2(1/2)=1$ (this is the answer as you claim in your previous post), which is true.

- Feb 3rd 2006, 10:58 AMCaptainBlackQuote:

Originally Posted by**ThePerfectHacker**

recurrence relation satisfied by some probability related to the task in hand,

solve the recurrence relation then use that to solve the problem.

It's rather more LaTeX than I fancy typing at the moment (I'm suffering from

too much keyboard hammering - its report writing time at work).

RonL - Feb 3rd 2006, 12:37 PMCaptainBlackQuote:

Originally Posted by**yiyayiyayo**

We want to know the probability in a long string of tosses of the

number of heads equalling the number of tails. In particular we want to

know the limit of this probability as the length of the sequence of

tosses tends to $\displaystyle \infty$.

Let $\displaystyle k_n$ denote the difference between the number of heads and the number

of tails after $\displaystyle n$ tosses. So we are asking for the probability that

$\displaystyle k_n=0$,

for at least one $\displaystyle n>0$.

Now suppose that at some stage in this sequence the difference between

the number of heads and the number of tails is $\displaystyle k$. Also let $\displaystyle P_k$ be the

probability that starting from a point where the difference is $\displaystyle k$, that

at some subsequent point the difference is $\displaystyle 0$. Then clearly:

$\displaystyle P_k=qP_{k-1} + pP_{k+1}$,

since with probability $\displaystyle p$ after the next toss the difference will be

$\displaystyle k+1$, and with probability $\displaystyle q=(1-p)$ it will be $\displaystyle k-1$.

Now this difference equation is the analog of a second order linear

ordinary differential equation with constant coefficients, and we solve

it in a similar way. I will explain it another time if you want to see

it, but the solution is:

$\displaystyle P_k=(q/p)^k$, if $\displaystyle p>q$,

$\displaystyle P_k=1$, if $\displaystyle p\le q$.

Now this does not immediately give our answer as by convention $\displaystyle P_0=1$,

as we in fact count the current difference in this process. But after

one toss we have a difference of $\displaystyle 1$ with probability $\displaystyle p$, and a difference

of $\displaystyle -1$ with probability $\displaystyle q$, and so the probability of the difference ever

returning to $\displaystyle 0$ is:

$\displaystyle P_{return}=pP_1+qP_{-1}$.

So, supposing $\displaystyle p>q$:

$\displaystyle P_{return}=p.(q/p) +qP_{-1}$.

Now $\displaystyle P_{-1}$ is equal to $\displaystyle P_1$, but with $\displaystyle p$ and $\displaystyle q$ interchanged, and so:

$\displaystyle P_{return}=p(q/p)+q \times 1=2q$.

That is $\displaystyle P_{return}=2 \times \min (p,q)$

RonL - Feb 4th 2006, 05:54 PMyiyayiyayoThank youQuote:

Originally Posted by**CaptainBlack**

The second one is from Cambridge College Math Institute and the answer to this problem will not be given untill several months later. Anyone who works it out can send email to puzzlemaster@cambridgecollege.edu with your solution.

Thank you , thank you for your thinking and typing,

and words fail me to say anything others.

:) ;) ;) ;) ;) - Feb 4th 2006, 06:24 PMThePerfectHacker
The problems were very nice problems.

- Feb 5th 2006, 09:48 AMThePerfectHacker
I was further thinking about the second problem you gave. I believe I have a simplified version other than I posted previously. I think (not completely proven but close to it) that all number which CANNOT be expressed as the sum of consecutives is of the form $\displaystyle 2^n$.

I will not post my solution now, but later on in a few hours, I do not have enough time now. - Feb 6th 2006, 02:47 PMThePerfectHacker
Let me show my proof to problem 2.

Notice that a number expressed, as $\displaystyle m$ consecutives (odd number), then we have,

$\displaystyle n+(n+1)+(n+2)+...+(n+m-1)$,

Thus,

$\displaystyle mn+\frac{m(m-1)}{2}$,

Now $\displaystyle m-1$ is even, thus,

$\displaystyle mn+mj$

where $\displaystyle j$ is an integer thus,

$\displaystyle m(n+j)$.

Thus, if a number can be expressed as a sum of $\displaystyle m$ (odd) consecutives, then it is divisible by $\displaystyle m$.

Now we prove, the converse (not exactly a converse you will see). That if a number is divisible by $\displaystyle m$ then, we can express it as a sum of consecutives (I did not say $\displaystyle m$ consecutives rather I said it can be expressed as consecutives!). If $\displaystyle m|n$ then there exists $\displaystyle k$ such as $\displaystyle mk=n$. Thus, instead of $\displaystyle k$ write $\displaystyle m(j+s)=n$ where $\displaystyle j=(m-1)/2$ (as before), thus we can find such an $\displaystyle s$. The problem is that $\displaystyle s$ can be a negative number. Thus, the number can be expressed as:

$\displaystyle n=s+(s+1)+(s+2)+...+(s+m-1)$.

The following is the foundation of the proof; observe that if a number is expressed as a sum of consecutives starting from a negative number then it still can be expressed as a sum of consecutives! Because they cancel each other out. Observe,

(-4)+(-3)+(-2)+(-1)+0+1+2+3+4+5+6+7

Now follow with me. A number is expressed as a sum of consecutives from a negative number. Then they cancel each other out, and you are left with,

5+6+7,

still a sum of consecutives.

The problem is of course if they cancel each other out in such a way then you a left with a single number. For example,

(-1)+0+1+2, becomes,

2.

But 2 is not expressing 2 as a sum of consecutives by just 2 (that is trivial).

But to show this does not happen over here is because since $\displaystyle m$ is an odd number, and zero is part of this expansion, thus there are a total of even numbers. Thus, either the number of negatives is more than positives (which is not possible). They are equal (which is not possible). Thus, the number of positives must overtake the number of negatives by and even amount! Thus at least two which is considered a sum of consecutives.

Now we have that ANY number divisible by any odd number CAN be expressed as a sum of consecutives. Thus, if a number IS NOT expressable as a sum of consecutives it must have the form $\displaystyle 2^n$.

Finally, we prove the converse, that if a number has the form $\displaystyle 2^n$ then it cannot be expressed as a sum of consecutives, then we have that,

$\displaystyle 2^n=a+(a+1)+...+(a+b-1)$

Thus,

$\displaystyle 2^n=ab+\frac{b(b-1)}{2}$

Thus,

$\displaystyle 2^{n+1}=2ab+b(b-1)$

Thus,

$\displaystyle 2^{n+1}=b(2a+b-1)$.

Since of equality and the fact we are using integers we have that $\displaystyle b$ cannot have odd factors thus,

$\displaystyle b=2^{m}$,

Thus,

$\displaystyle 2^{n+1}=2^m(2a+2^{m+1}-1)$

But the right factor of the LHS is odd,

Thus an impossibility.

Thus, all and only thus of the form $\displaystyle 2^n$. Cannot be expressed as a sum of consecutives.

Q.E.D.

I hope I did not make a mistake in proof. I think this is a nice problem and I had fun solving it. - Feb 6th 2006, 06:48 PMyiyayiyayo
You're very kind,and I really hope too much typing didn't trouble you. Though I want to say something,my poor English frustrated me, sorry.

In one word, your proof is wonderfull.Thank you.