## Problem 689

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
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.

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 post any spoilers
harrowing_experience
Posts: 2
Joined: Sun Nov 10, 2019 1:56 pm

### Problem 689

I was convinced I understood this until my answer was rejected. I have solved it 3 different ways and keep landing at the same place.

Trying not to give any spoilers, am I correct in saying
f(3/8) = f(0.011 (base 2)) = 13/36,
f(7/8) = f(0.111 (base 2)) = 49/36, and
f(0.1111...(base 2)) = pi2/6 ?

Also, the question asks for the answer rounded to 8 places after the decimal, so does format matter? That is, could I give a correct answer formatted as either 0.xxxxxxxx or .xxxxxxxx and be accepted?
RobertStanforth
Posts: 1454
Joined: Mon Dec 30, 2013 11:25 pm

### Re: Problem 689

Your values of $f$ are correct (albeit with the interpretation of the $\pi^2/6$ value as a limiting case, because $f(x)$ is only defined if $x$ is strictly less than 1).

harrowing_experience
Posts: 2
Joined: Sun Nov 10, 2019 1:56 pm

### Re: Problem 689

Thanks for the clarification. I'm still worried that f(x) may not be clearly defined.

For example, the decimal fraction 1/2 has two binary representations: 0.1000... and 0.0111.... And those lead to
f(1/2) = f(0.1000.. (base 2) ) = 1, and
f(1/2) = f(0.0111.. (base 2) ) = π2/6 - 1.
While these are clearly different expressions, the different values of each seem to contradict a clean definition of f(x) in the problem. For other values of x, this leads me to situations where f(x) > 0.5 by one definition and f(x) < 0.5 for the other.

Can someone help me spot a flaw in my logic?
jaap
Posts: 554
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

### Re: Problem 689

harrowing_experience wrote: Wed Nov 20, 2019 3:21 am Thanks for the clarification. I'm still worried that f(x) may not be clearly defined.

For example, the decimal fraction 1/2 has two binary representations: 0.1000... and 0.0111.... And those lead to
f(1/2) = f(0.1000.. (base 2) ) = 1, and
f(1/2) = f(0.0111.. (base 2) ) = π2/6 - 1.
While these are clearly different expressions, the different values of each seem to contradict a clean definition of f(x) in the problem. For other values of x, this leads me to situations where f(x) > 0.5 by one definition and f(x) < 0.5 for the other.

Can someone help me spot a flaw in my logic?
The only values of x where the binary representation is not unique are those which are rational with denominator equal to a power of 2. These values of x form a set of measure zero, so the probability of choosing such a value of x is zero.

So while you are right that f is not well defined for all x, these values have no effect on p(a), and p(a) is well defined.