Problem 329
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
- jaap
- Posts: 588
- Joined: Tue Mar 25, 2008 3:57 pm
- Contact:
Problem 329
Problem 329 (View Problem)
Does the frog croak for its starting square, or is its first croak for the square it lands on after its first jump?
(On rereading the question I'm pretty sure it does croak for the starting square. Was the wording changed or did I just fail at reading the first time?)
Also, there is a spelling error in the question: "croacks".
Does the frog croak for its starting square, or is its first croak for the square it lands on after its first jump?
(On rereading the question I'm pretty sure it does croak for the starting square. Was the wording changed or did I just fail at reading the first time?)
Also, there is a spelling error in the question: "croacks".
-
harryh
- Posts: 2091
- Joined: Tue Aug 22, 2006 9:33 pm
- Location: Thessaloniki, Greece
Re: Problem 329
Yes, there is a croak for the first square too (the wording has not been changed).
Thanks for pointing out the spelling error - now fixed.
Thanks for pointing out the spelling error - now fixed.
-
shachark
- Posts: 4
- Joined: Sat Mar 12, 2011 9:17 pm
Re: Problem 329
My strategy is comparing the given pattern to the probable pattern (according to a small prime sieve), and yet, although my fraction addition and reduction works fine, there seems to be some kind of a problem, the idea is comparing the first square, and the following 14 moves, right?

-
elr
- Posts: 67
- Joined: Thu Apr 09, 2009 9:47 am
Re: Problem 329
you should remember that there are many different ways to reach the "probable pattern" ...
Last edited by elr on Thu Mar 24, 2011 8:49 pm, edited 1 time in total.

-
shachark
- Posts: 4
- Joined: Sat Mar 12, 2011 9:17 pm
Re: Problem 329
Well, My algorithm calculates all the possible "walks", (The first move is 0 since first spot counts, and then +/-1), then I apply them on all starting positions (dropping those who exceed limitations of course), meanwhile, I determine probabilities by comparing the right pattern, to the wanted pattern. Did I understand correctly?

-
elr
- Posts: 67
- Joined: Thu Apr 09, 2009 9:47 am
Re: Problem 329
seems so
just make sure that you calculate the probability exactly as the question describe

-
browni3141
- Posts: 18
- Joined: Thu Jan 20, 2011 2:06 am
Re: Problem 329
I think I'm close. My random generator is slightly off from my proper solution though. Are these correct:
Probability of "P" == 119/300
"PP" == 230/1497
"PNPN" == 21271/322704
Probability of "P" == 119/300
"PP" == 230/1497
"PNPN" == 21271/322704

-
shachark
- Posts: 4
- Joined: Sat Mar 12, 2011 9:17 pm
Re: Problem 329
Well, I think I've found what the problem was, as my function was not a probability function (by definition, the sum wasn't 1), the only problem now is that the result is huge (really huge).
is the answer for "PPPP": 169783/6804000?
is the answer for "PPPP": 169783/6804000?

- GenePeer
- Posts: 112
- Joined: Sat Apr 03, 2010 1:14 pm
- Contact:
-
sivakd
- Posts: 217
- Joined: Fri Jul 17, 2009 9:37 am
- Location: California, USA
- Contact:
- GenePeer
- Posts: 112
- Joined: Sat Apr 03, 2010 1:14 pm
- Contact:
-
ukimiku
- Posts: 13
- Joined: Sun Jul 04, 2010 12:38 am
Re: Problem 329
Could someone please confirm that the probability for "PP" is 173/1125? I got "P" right, but my resulting fraction, though reduced, is awfully long...
Thank you.
Regards,
Thank you.
Regards,
There are two kinds of people: those who divide eyerything up into two kinds, and those who don't.
http://otac0n.com/ProjectEuler/Flair/ukimiku.png
http://otac0n.com/ProjectEuler/Flair/ukimiku.png
-
jochenkeutel
- Posts: 6
- Joined: Thu Oct 13, 2011 2:01 am
-
jochenkeutel
- Posts: 6
- Joined: Thu Oct 13, 2011 2:01 am
Re: Problem 329
Please forget my last post: The number mentioned there is wrong.
I've found the correct solution now, also for the full string.
I've found the correct solution now, also for the full string.
-
m4rius
- Posts: 1
- Joined: Fri May 08, 2020 10:00 pm
Re: Problem 329
Hello,
is it right to assume that the events "nth croak equals Xn", where Xn in {P, N}, are stochastically independent?
Because that's what I did and my solution seems to be wrong.
My idea was to first calculate Pn = P("frogs sits on a prime after n jumps"), P0 = 19/100 = 95/500, P1 = 24/125, P2 = 571/3000, ...
And then for n = 0..14 calculate
Qn = Pn x P("sits on a prime and croaks Xn") + (1 - Pn) x P("does not sit on a prime and croaks Xn") where X = PPPPNNPPPNPPNPN.
That is Qn should exactly be P("nth croak equals Xn") and the product of the Qn should be the solution. But it's not, so where am I wrong?
Best
is it right to assume that the events "nth croak equals Xn", where Xn in {P, N}, are stochastically independent?
Because that's what I did and my solution seems to be wrong.
My idea was to first calculate Pn = P("frogs sits on a prime after n jumps"), P0 = 19/100 = 95/500, P1 = 24/125, P2 = 571/3000, ...
And then for n = 0..14 calculate
Qn = Pn x P("sits on a prime and croaks Xn") + (1 - Pn) x P("does not sit on a prime and croaks Xn") where X = PPPPNNPPPNPPNPN.
That is Qn should exactly be P("nth croak equals Xn") and the product of the Qn should be the solution. But it's not, so where am I wrong?
Best
- sjhillier
- Administrator
- Posts: 561
- Joined: Sun Aug 17, 2014 4:59 pm
- Location: Birmingham, UK
- Contact:
Re: Problem 329
I'm not sure I entirely understand the question, but I think the answer is "No".m4rius wrote: Fri May 08, 2020 10:22 pm is it right to assume that the events "nth croak equals Xn", where Xn in {P, N}, are stochastically independent?
Let's put it this way. If the frog started near the small numbers (around 5 say), the density of primes there is quite large, and so the probability of any sequence is different to the probability if it had started near (say) 250, where there are few primes. Taking an average prime distribution over the whole range is not going to capture the slightly different probabilites which arise from the actual local distribution where the frog (randomly) started.
-
karabonev
- Posts: 5
- Joined: Wed May 01, 2019 3:07 pm
Re: Problem 329
I've been struggling with this problem for a while.
My answer for P is right but PP is a bit off.
Let P(x) be the chance to croak P on jump x.
P(1) = 119/300
I assume that the chance to hear PP is P(1) * P(2).
Previous posts suggest that the probability for PP is 173/1125 so I expect P(2)=692/1785.
However, I get P(2)=149/375.
Can anyone confirm if my assumption is correct?
My answer for P is right but PP is a bit off.
Let P(x) be the chance to croak P on jump x.
P(1) = 119/300
I assume that the chance to hear PP is P(1) * P(2).
Previous posts suggest that the probability for PP is 173/1125 so I expect P(2)=692/1785.
However, I get P(2)=149/375.
Can anyone confirm if my assumption is correct?



