Page 2 of 3
Re: Problem 371
Posted: Tue Feb 21, 2012 8:40 am
by thundre
Ra1n wrote:That makes sense. What level of Math do you think the "average" person would need to complete a problem like 371? Is it even remotely possible for someone with just Calculus II knowledge and a bit of Linear Algebra to solve a problem like this? (I'm a college freshmen, but these problems intrigue me so much!!)
This problem can be solved using basic probability, if you have the right insight.
Re: Problem 371
Posted: Sun Feb 26, 2012 5:54 am
by viv_ban
I am having issues with precision. Can somebody suggest me how to get over the problem of precision. I have tried logarithm-antilogarithm to approximate but it does not give correct answer.
Re: Problem 371
Posted: Sun Feb 26, 2012 12:54 pm
by thundre
viv_ban wrote:I am having issues with precision. Can somebody suggest me how to get over the problem of precision. I have tried logarithm-antilogarithm to approximate but it does not give correct answer.
Lately I've been using the BigFraction class from the Apache Commons Math library. Although for this problem the doubleValue() method failed me; I had to find another way to get the required decimal answer. (I submitted a bug-fix which should be in release 3.0.)
Re: Problem 371
Posted: Mon Feb 27, 2012 8:32 am
by sivakd
There are solutions in C++ using just double. So, you don't need anything more than that.
viv_ban wrote:I am having issues with precision. Can somebody suggest me how to get over the problem of precision. I have tried logarithm-antilogarithm to approximate but it does not give correct answer.
Re: Problem 371
Posted: Thu Jun 21, 2012 7:04 pm
by PurpleBlu3s
I have only been able to get a formula that works with integers - and it doesn't extend to reals. Is it possible to come up with a formula to work with reals or does one need to find the two integers the answer lies between and do something else from there?
Re: Problem 371
Posted: Fri Jun 22, 2012 1:25 pm
by PurpleBlu3s
Can anyone confirm the probability of not having a win after seeing 10 plates is 0.95586930 (8 s.f.)?
Re: Problem 371
Posted: Mon Jun 25, 2012 4:03 am
by thundre
PurpleBlu3s wrote:I have only been able to get a formula that works with integers - and it doesn't extend to reals. Is it possible to come up with a formula to work with reals or does one need to find the two integers the answer lies between and do something else from there?
Being able to calculate the probability of a win at each step is an OK start. But there is a certain concept you need to apply to finish this problem. Saying what it is would be a spoiler, so I'll just say I used the same concept in problems 280, 316, 339, and 367.
Re: Problem 371
Posted: Sat Jul 28, 2012 1:09 pm
by gnome
sivakd wrote:I finally solved this and hopefully no one would object if I write the statement "ignore that the license plates have letters completely, just assume there are 3 digit license plates and many cars can have the same 3 digits such that the probability of seeing any number is the same for any ith car seen". It may be same as the Note: provided in the problem, but for people who have difficulty understanding the note ...
Thanks for that comment! I solved the harder problem first, thinking that Seth keeps a notebook where he writes down any license plate he sees, and does not count plates he has seen before. (Safety notice: do not take notes while driving. I cannot be held liable for any property damage or physical injury.)
So this would have been the right interpretation:
Whenever the numbers of two (not necessarily different) licence plates seen on his trip add to 1000 that's a win.
Re: Problem 371
Posted: Fri Nov 23, 2012 3:19 am
by thkang
500 is a curious number..
Re: Problem 371
Posted: Sat Mar 22, 2014 10:33 pm
by jake223
E.g. MIC-012 and HAN-988 is a win and RYU-500 and SET-500 too. (as long as he sees them in the same trip).
There shouldn't be a period between "SET-500 too" and "(as long" (I think).
Re: Problem 371
Posted: Fri Jun 27, 2014 10:29 pm
by oleglyamin
I'm confused by seemingly contradicting statements in this thread.
On one hand
thundre wrote:Nadando wrote:So why isn't this just a Bernoulli random variable with p = 999 / 1000000?
It's not a Bernoulli random variable because p depends on what happened in the previous trials.
On the other
rayfil wrote:If so, for example, SET-500 and SET-500 will be a win. Right?
Right. Even if it's XYZ-500 and ABC-500, or any other letter combinations.
The last quote implies that the same license plate can be "re-drawn" many times. Doesn't it contradict the first quote, which says that the probability of seeing certain number on a license plate depends on what happened in the previous trials? Which is it? I'm not asking for any clues, I'm just trying to make sense of the problem.
Re: Problem 371
Posted: Wed Jul 02, 2014 10:04 pm
by thundre
The inputs are independent. The probability of seeing a given number at a given time is 1/1000.
What I was saying was that the probability of a win at (for example) the 6th license plate depends on the values of the first 5 plates -- in particular, whether any were duplicated.
Re: Problem 371
Posted: Wed Dec 16, 2015 10:16 pm
by demongolem
Ah good, so you can see the same license plate twice, which I am curious as to why the original problem does not state one way or the other in some form.
But just one more question while I am it. So, the license plate of Seth is irrelevant? For all we know, he could be driving a car with Washington plates?
Re: Problem 371
Posted: Mon Mar 07, 2016 1:00 pm
by oleglyamin
Could someone go to this problem's closed forum and answer the question in my last post? Thanks.
Re: Problem 371
Posted: Tue Sep 03, 2019 12:22 am
by RishadanPort
This probably has already been explained in this thread, -- but I want clarity...
Is it possible for him to see the license plate SET-500, and SET-500 (resulting in a win) on the same trip or not?
in my algorithm, I treat that as allowed, and I'm fairly certain it is done correctly-- however the projecteuler does not accept my answer.
Re: Problem 371
Posted: Tue Sep 03, 2019 12:37 am
by RishadanPort
I'm not sure if this is the right place to ask this...
But lets suppose we see the numbers 1-500 already.
Would the expected number of plates to see for a win be 2, or am I missing something.
Re: Problem 371
Posted: Tue Sep 03, 2019 4:20 am
by RishadanPort
Nevermind I figured out why...
Indeed 500 is a magic number.
Re: Problem 371
Posted: Thu May 07, 2020 11:45 pm
by hamsterofdeath
how is "expected to win" defined exactly? the chance of seeing a pair must be >50%?
Re: Problem 371
Posted: Fri May 08, 2020 1:34 am
by Animus
hamsterofdeath wrote: Thu May 07, 2020 11:45 pm
how is "expected to win" defined exactly? the chance of seeing a pair must be >50%?
It looks like you are trying to answer a question different from that one asked in the problem text.
So analyzing the licence plates adding game you could for example be interested in how many cars Seth must see in order to have a winning chance of at least 10 % or 50% or 90%, which would all give different answers.
However, the problems asks for something else. Just imagine that Seth writes down each number plate until a win is reached (and doesn't add any car after winning). Whenever he repeats playing the game he always starts a new list. If he plays this game very often, you will see that the number of cars written down on the lists varies around some average. The problem is asking for this average, respective the expected number of cars on any list, to be more precise.
Re: Problem 371
Posted: Fri May 08, 2020 1:59 am
by brob26
hamsterofdeath wrote: Thu May 07, 2020 11:45 pm
how is "expected to win" defined exactly? the chance of seeing a pair must be >50%?
Expanding on
Animus' response, "expectation" here is defined in the statistical sense. The
wikipedia page is a good place to start if you haven't encountered the concept previously.
I do remember it being a bit confusing when I was first learning, as "what one expects" in this statistical sense is not quite the same as what one might interpret from other use in English.