This problem related to the last programming exercise in Andrew Ng's Course. The objective of exercise is build a recommender system by implementing gaussian distribution algorithm. I have done that exercise, but I still not fully understand the algorithm to find best threshold.
To be honest, since I do not have appropriate mathematical skill, I provided some symbolic notations and its graphical visualization. Hope this formulation make sense:
Let:
$Q = \{x\ \mid x \in \{0, 1\}\}$
$R = \{x\ \mid x \in \mathbb{R},\ 0 < x < 1 \}$
$S = (a_i)_{i=1}^{n} \mid R_{min} \leq a \geq R_{max}$
Constrains:
$\{R \implies Q\}$: Each probability $R_i$ has binary value $Qi$
$S$ is arithmetic series $\{R_{min}$, ..., $R_{max}\}$ with predefined range $b$.
Solve:
$F_{max}$ while minimize $S_i$
The formulation of $F$ described in an image below: