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

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)) = pi^{2}/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?

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).

For answer format, the leading zero is required, as in 0.abcdefgh

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.

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.