How to calculate the expected value of the best option

Quick sidenote

Due to complications, despite generous efforts from the audio team, the audio recording is almost completely inaccurate for several parts of this. listener’s discretion is advised.

Also, it has come to my attention that this does not include the discrete case, and the probability density functions are a bit wonky, as the method currently provided is optimized purely for comparing abstract functions. At the moment, the function treats “PDF”*s as though there is a uniformly randomly distributed input (x), and a non-uniform output (). The “PDF”* of is equal to for the continuous function , ( being the inverse function of .). I am working to fix this.


In summary, the function takes input functions and spits out the expected highest output given some randomly generated input for each input function.

This can be used to see how many jobs you should consider, how many charities to look into, and many other things. For the sake of the example, we’ll use restaurants.

Let’s say you want to know how many restaurants you should try before deciding where you should go to dinner. Each restaurant is assigned a “Tastiness value” between −1 and 1, with a uniform probability distribution[1][2]. This can be expressed with the function .

For that, you would have input into the function on desmos.

and being however many restaurants you visit.

the value of then predicts the expected value of the best restaurant you find. input different values for until the value of meets your needs.

Now, let’s say that you now have the option of delivery.

The distribution of good delivery places to bad places is [3][4]

Now, you would add the inputs ,

and being the number of delivery places you order from.

change and until you are satisfied with the result.



How to use


What the value


How to edit

The first


The number of times

is evaluated

The minimum value of x for

The maximum

value of x for


The outputJust look at it
All things with a 2 (like )The second function’s valuesSame as with 1, just edit the ones with a 2 instead.
All things with a 3 (like )The third function’s valuesSame as with 1, just edit the ones with a 3 instead.

How to add a function[6]

Optional Why it works

(It’s a link to a post on why it works.)

If you have any suggestions as to how I can make this clearer, or a better way of finding the expected value of the best option, or any wording that could be done differently, tell me. (ONLY if you want). No pressure.

If there’s anything incorrect, please tell me.

  1. ^

    A uniform probability distribution means that the probabilities of each outcome are the same.

  2. ^

    The distribution could’ve been different. For example, if no restaurant is bad, and good restaurants have diminishing returns, the function could be , where or if restaurants are more likely to be good, the function could be , where .

  3. ^

    This would be because you could look at the rating of each place on most delivery apps, which eliminates terrible places, but the food is less fresh, causing slightly less food. (This doesn’t perfectly reflect reality though)

  4. ^

    The formula doesn’t work if there’s a correlation in-between values (For example, maybe you get delivery more from the good restaurants, making a correlation between restaurants and delivery.)

  5. ^

    If it says that is undefined, that’s probably either because of

    1. Limited processing power (Desmos thinks which is undefined

    2. An undefined input (for example, if , and is undefined because is undefined.

  6. ^

    on Desmos, to do , simply write a_b. This works for all a and b, and is used for log [ = log_a(b)]