Who can solve this?

Hey Veeky Forums, I have a math problem for you.

Let's say we have a circle with a radius of 1.
We start on the edge of the circle.
Now, every step we move with a distance of 1 in a random direction.

How many steps on average does it take to leave the circle?

Other urls found in this thread:

en.wikipedia.org/wiki/Euler–Mascheroni_constant
twitter.com/SFWRedditGifs

1, because I'm always lucky and a wizard.

wrong

What is the pdf nigger.

On average it only takes one step to leave the circle. You have a zero percent chance to land on the circle on your first step since you can only land at the two points 1 rad away and you have an infinite number of points (the interval) of all points 1 away that aren't on the circle

185

...

No, you don't understand.
We're not just talking about being exactly on the edge of the circle here.
You're inside the circle when you're INSIDE the circle.

wrong...

What are you talking about?

Okay, how much distance from the edge exactly? You know you can arbitrarily get close to the boundry of circle righr? Also you failed to proviee a probability measure.

Probability density function, aca, you cannot say random like it means something brainlet.

Sorry, I'm not that well versed in math.
Uniform I guess?

Nah, if he's standing on the edge he has 1/3 chances of moving into the circle. Assuming uniform probability distribution with the angle of his movement being the random variable

meant to quote

>how much distance from the edge exactly?

I don't understand what you mean.
You're inside the circle when you're inside the circle...

>uniform probability distribution with the angle of his movement being the random variable
Yes, this.
Thank you for expressing it for me.

Yea, but a starting point is well, a point... You need to define it, exactly in te edge works fine.

Yeah the starting point is exactly on the edge.

In case anyone is wondering, this is what the distribution looks like.

1.5

The proof is trivial and left as an exercise to the reader.

Ok if we're gonna do simulations, I might as well tell you the approximate decimal answer I got by simulating it:

~1.55981

not understanding the basic shit he said makes you the brainlet.

Hey, for all I know he coukd assigned weights to some steps:^)

Uniform, obviously.

wrong

He clearly means the uniform distribution.

Same.

You can't take 1.5 steps.

You can take 1 step or 2 steps.
1 step is still on the circle's edge.
2 is the correct answer you brainlets.

Nice, but can you increase the accuracy?
Cause your answer almost makes it seem like the answer is pi/2, but I don't think that's the answer. I think it's slightly less than that.

You can't have 1.5 kids but that's still the average for American households.

I don't think you're understanding the problem.
Just to clarify, here's a random example where it took 6 steps to leave the circle.

(The line segments are supposed to be the same size as the circle's radius, but I didn't really measure them.)

And here's a random example of where it took just 1 step to leave the circle.

Trying to solv this mess, but I'm having difficulty considering the probability of staying in the circle when a point is inside the circle. I'm sure it must depend solely on it norm, but I'm not sure, for a point outaide the circle I used the tangents, but here i don't know.

>random direction

Meaning everything to the right of this red line is also a likely direction, all of which still take 1 full distance/step, if the starting point is the edge where the arrow is..

yes, correct

So I'm guessing first find the distribution function in terms of distance r from the center of the circle. Then use that to find the probability of remaining in the circle given that you currently are some point within the circle. After that solve for the expected value by Negative Binomial Distribution. The distribution even fits the plotted graph.

idk sounds good

I would think that the chance of the second step staying inside the circle is the average of 1/3 and 1/2. But the simulation seems to say not. It seems to say this chance is 2/5 instead of 5/12. So Either my analysis is wrong or the simulation is wrong.

Ah OK, I think I have it. The chance of the nth step staying inside the circle is the average of the (n-1)th and (n-2)th steps.

2/3+2(1/3)(1-(1/3+1/2)/2)+3(1/3)(5/12)(1-(5/12+1/3)/2)+4(1/3)(5/12)(15/24)(1-(15/24+5/12)/2)...

Does anyone know any methods to solve for g(x)?

I get ~1.56 with simulations too

Are you saying the chance of still being in the circle after 2 steps is 2/3+2(1/3)(1-(1/3+1/2)/2)+3(1/3)(5/12)(1-(5/12+1/3)/2)+4(1/3)(5/12)(15/24)(1-(15/24+5/12)/2)... ?

[math]1+\gamma[/math]

fuaaarrrrrkkkk explain

uhh what's γ?

No, that is the answer to the question you posted. The chance of still being in the circle after 2 steps is 2/3+(1/3)(1/3+1/2)/2

Made a nice picture :)

en.wikipedia.org/wiki/Euler–Mascheroni_constant

Oh shit
Congrats dude, you found the answer

euler mascheroni constant

Hey guys looks at all the answers I found durr

I don't know if it's correct or not
Does it come out to about 1.57721?

look at these code monkeys being so smart and solving problems

nice

On the 5th step it is at 1.57889...

how the fuck did you get it

Wow good job dude

Wait now I'm starting to doubt if this is even the right answer.

Because my simulation says it's something like 1.5598 instead of 1.57721

Probably entered the numeric mean into Wolfram Alpha.

Prove me wrong by posting a proof.

every fucking step is random!? fuck you op this isn't determinable

this is the most braindead shit I've seen in a long time

...

?

You found the probability of leaving the circle in 1 step, good job.
But the question was how many steps it takes on average to leave the circle.

The probability of being within the circle at step n is given by 2/3^n. This means that the expected value of n is given by [math]\sum^{\infty}_{n=0} \frac{2n}{3^n}[/math]. This sum converges to 1.5.

>The probability of being within the circle at step n is given by 2/3^n
wrong

Shit, I only considered the cases when your step puts you on the edge of the circle. My bad.

I don't fucking know.

Alright, I just did some extremely shitty math and made a bit of progress. I think I found the probability of leaving the circle in one step from point (x,y). First, find the distance between (x,y) and (0,0), which is given by [math]\sqrt{x^2+y^2}[/math]. Then, plug this value in to the equation to find the y-coordinates of the touching points of two intersecting circles. This gives us touching points with a positive y-coordinate of [math]\frac{1}{2}\sqrt{-(x^2+y^2)+4}[/math]. Now, take the arcsin of the positive root and divide by pi to get the probability of leaving the circle in one step: [math]P(x,y)=\frac{\arcsin(\frac{1}{2}\sqrt{-(x^2+y^2)+4})}{\pi}[/math]. Can anyone verify my math?

I think this means it's twice as likely to land in the region on the left as the parts on the top right and bottom right.

[math]\sum_{j=1}^{s} (j(1-\frac{2 a_{j-1}-(-1)^{j-1}}{3*2^{j-1}}) \prod_{k=1}^{j-1} \frac{2 a_{k-1}-(-1)^{k-1}}{3*2^{k-1}})[/math]

a0 = 2

[eqn]\sum_{j=1}^{s} (j(1-\frac{a_j}{3*2^{j-1}}) \prod_{k=1}^{j-1}\frac{a_k}{3*2^{k-1}})[/eqn]
[eqn]a_n = 2 a_{n-1}-(-1)^{n-1}[/eqn]
[eqn]a_1 = 2[/eqn]

hold on let me verify this

Thanks for having an actually interesting thread, OP

Hmm some corrections:

[eqn]2/3+\sum_{j=2}^{s} (j(1-\frac{a_j}{3*2^j}) \prod_{k=1}^{j-1}\frac{a_k}{3*2^k})[/eqn]
[eqn]a_n = 2 a_{n-1}-(-1)^{n-1}[/eqn]
[eqn]a_0 = 2[/eqn]

Fucking hell, last line should be

[eqn]a_1 = 2[/eqn]

I don't think you know what you're doing.

Here's what I have so far:

Let [math]d_t[/math] denote the distance from the origin after [math]t[/math] steps. Then [math]d_0 = 1[/math] and [math]d_{t+1} = \lvert d_t + \exp i \theta \rvert = \sqrt{d_t^2 + 2 d_t \cos \theta + 1}[/math] where [math]\theta \sim \mathcal{U}(0, 2\pi)[/math] and thus [math]\cos \theta[/math] has an arcsine distribution.

I meant [math]\theta_t[/math] since the angle depends on [math]t[/math].

ehh if I run this with s = 10, I get 46.28

Circle has no edges.

I must be writing it wrong, because on s = 8 I have 1.5534

2/3+2(1/3)(1-(1/3+1/2)/2)+3(1/3)(5/12)(1-(5/12+1/3)/2)+4(1/3)(5/12)(3/8)(1-(3/8+5/12)/2)+5(1/3)(5/12)(3/8)(19/48)(1-(3/8+19/48)/2)+6(1/3)(5/12)(3/8)(19/48)(37/96)(1-(37/96+19/48)/2)+7(1/3)(5/12)(3/8)(19/48)(37/96)(25/64)(1-(37/96+25/64)/2)+8(1/3)(5/12)(3/8)(19/48)(37/96)(25/64)(149/384)(1-(149/384+25/64)/2)

No, it was my mistake.
Your solution is correct! :)

I have no idea how you did it though,
or how you came to the insight that the chance of the nth step staying inside the circle is the average of the chances of the (n-1)th and (n-2)th steps staying inside the circle.

Go back to the picture in which shows the possible 2nd steps are simply ranging uniformly over the internal angles 2pi/3 to pi, from starting at the edge of the circle to the middle of the circle. Dividing the internal angle by 2pi gives the probability of staying in the circle. So the probability of staying in the circle at the 2nd step is 5/12.
Then on the 3rd step it ranges from starting in the same arc as the 2nd step (5/12) to starting at the edge of the circle (1/3). And the 4th step ranges from starting at the 3rd step to starting at the 2nd step, etc.

0.72

no, sorry
this guy already got it , it's 1.557943...

I'm leaving now bye

what I thought it was
((pi+e)*0.1)+1

kek

What? How is there 10% probability that you will need 3 steps! The maximum is always 2 steps. Garbage in, garbage out.

I fucking hate Python I get why it's so useful but I just don't like it at all. The syntax, the white space, ugh

well the edge of the circle is round user so its probably more than 50% chance to leave on the first step

There is no upper limit; it could take an infinite amount of steps. Here are just two ways you could theoretically be trapped forever, no matter how small that chance.

>bounce between the edge and the origin forever
>bounce across six equidistant points along the edge
>Combination of the two, also

So the answer has been posted
Can it be derived using pen&paper?
I'm a brainlet trying to learn more, and maths make the most sense to me in this way.

>are we assuming we can pass through the circle?
>if so
shouldnt be more than 2.

moving without leaving the circle would mean you make a straight line directly to the otherside on your first try. barring this 1/360 chance doesnt occur a second time consecutively, you would leave the circle. i guess if we're going on rational likelihood instead of pure probability, the answer would be one.

sorry, maybe I should have explained it clearer
see and but I think this user already solved it btw

Personally I don't think that user got it. His answer doesn't make sense to me and his premise that the probability of it taking n steps is the average of the probabilities of it taking (n-1) and (n-2) steps is just plain wrong.

I think he just stumbled on a series that gave a somewhat correct looking answer after much messing around. Closed form expressions that approximate arbitrary truncated decimals are not difficult to come by as shown here

infinity

Shouldnt it just be 1.5 exactly?
The probably of leaving on the nth step is (2/3)*(1/3)^(n-1) and the number of steps itll take is n times that.
So according to wolfram, the sum from 1 to infty of n*(2/3)*(1/3)^(n-1) = 1.5

> the probability of it taking n steps is the average of the probabilities of it taking (n-1) and (n-2) steps is just plain wrong.
That was not my premise. My premise is that the probability of staying in the circle at the nth step is the average of the probabilities of staying in the circle at the (n-1)th and (n-2)th step. This is apparent if you visualize the possible ranges for each step. The formula I posted directly follows from that premise:

>The probably of leaving on the nth step is (2/3)*(1/3)^(n-1)
The probability of leaving on the 2nd step is the probability of not leaving on the first step multiplied by the probability of leaving on the second step. The range of possibilities for the second step can be seen here and ranges uniformly between internal angles 2pi/3 and pi. This means that the chance of staying in on the second step is (1/3+1/2)/2 = 5/12. So the chance of taking two steps and being outside the circle is (1/3)(1-5/12) = 7/36 which means your formula is wrong.

Why? It looks like pseudocode which is great.

>the probability of staying in the circle at the nth step is the average of the probabilities of staying in the circle at the (n-1)th and (n-2)th step

Why?

See