Nothing exciting or catastrophic here! Just a Friday afternoon puzzle entry on the successor to The Riddler (which I had not visited for a long while)… The first riddle reads as follows:
A random number generator on my calculator should generate random numbers between 0 and 1. But my suspicion is that the calculator is “tanked,” meaning it only generates random numbers between 0 and some value 0 < a < 1. Beyond that, I have no knowledge regarding the value of a. At the moment, it’s equally likely to be any value from 0 to 1. As an experiment, I ask the calculator to generate one random number. It produces a value of exactly 0.5. Based on this result, what can I expect the value of a to be, on average?
This is a direct (Bayesian) calculation of a posterior expectation when a given x=0.5 (a Uniform (0,a) realisation) is distributed as 1/(a log(2)) over (½,1), with expectation 1/(2 log(2)), about 0.72.
The added riddle just modifies the conditioning event (bringing it closer to Bayes experiment):
A second calculator is similarly “tanked.” As before, every value of a between 0 and 1 is equally likely at first. A friend generates one random number and only reveals that it’s somewhere between 0 and 0.5. On average, what can I expect the value of a to be?
This is also a direct (Bayesian) calculation with a Bernoulli output z, with probability min(0.5,a)/a, which results in a posterior expectation of a equal to 3/(4*(1+log(2))), about 0.44. And… I happened to get selected for my (correct) answer to this question!


![My friend E.J., along with Dora Matzke,from the University of Amsterdam, are writing a [not-for-babies] Bayesian book from their Master course 'Bayesian Inference for Psychological Science'. Chapters are put on-line as soon as they become available. Most enjoyable prose, with, obviously, many historical references. The latest being about Buffon.](https://i0.wp.com/www.bayesianspectacles.org/wp-content/uploads/2023/08/Cover.jpg?w=450&ssl=1)

