Curvature function as a random variable with uniform distribution Let $(S,g)$ be a Riemannian  surface. Then the curvature function $\kappa: S\to \mathbb{R}$ can be counted as a random variable. So it produces a probability density function
$f_g:\mathbb{R}\to \mathbb{R}$. Similarly every Riemannian manifold $(M,g)$ introduces a probability density function $f_g$ associated with  the scalar curvature $R:M\to \mathbb{R}$ as a random variable.
Question: Can one equip  a compact surface  $S$ with a Riemannian metric $g$ such that the resulting probability distribution be a uniform distribution, i.e the density function $f_g$
be a constant function ? What about the case of Riemannian manifolds, namely dimension greater than 2 ? If the answer is yes, can we choose an analytic Riemannian metric with the above mentioned property ? (The distribution associated to the curvature function be uniform.)
 A: Any surface, compact or otherwise, admits a metric with constant scalar curvature, so we can always find metrics with uniform density. Furthermore, any compact manifold admits a metric of constant scalar curvature in its conformal class, by the solution to the Yamabe problem.  On the other hand, the scalar curvature measures the deviation of the size of small geodesic balls of radius $\varepsilon$ around a point compared to corresponding balls in Euclidean space,  but this deviation has size $\varepsilon^{n+2}$. As such, if the scalar curvature is non-constant, its induced measure is non-uniform.
Edit with more details:
Here is a more detailed derivation of why it is necessary for the scalar curvature to be constant in order for the induced measure to be uniform.
Suppose $p \in M$ is a point with scalar curvature $S$. The scalar curvature satisfies the identity:
$$ \frac{\operatorname{Vol}(B_\varepsilon(p) \subset M)}{\operatorname{Vol}\left(B_\varepsilon(0)\subset {\mathbb R}^n\right)} =
  1 - \frac{S}{6(n + 2)}\varepsilon^2 + O\left(\varepsilon^4\right),$$
so if we consider a ball of radius $\varepsilon$ around $p$, we have that the average scalar curvature in this ball satisfies the following.
$$\int_{B_\varepsilon(p)} S \, d \mu = \operatorname{Vol}(B_\varepsilon(p)) ( S(p) +O(\varepsilon) ),  $$
where the error depends on the gradient of the curvature. Combining this estimate with the previous one, we have that
$$\int_{B_\varepsilon(p)} S \, d \mu = \frac{\pi^{n/2}}{\Gamma\bigl(\tfrac n2 + 1\bigr)} \varepsilon^n \left( 1 - \frac{S}{6(n + 2)}\varepsilon^2 + O\left(\varepsilon^4\right) \right) \left( S(p) +O(\varepsilon) \right).$$
Simplifying this, we find that
\begin{eqnarray}\int_{B_\varepsilon(p)} S \, d \mu 
& = & S(p) \frac{\pi^{n/2}}{\Gamma\bigl(\tfrac n2 + 1\bigr)} \varepsilon^n +O( \varepsilon^{n+1}) \\
& = & S(p) \operatorname{Vol}\left(B_\varepsilon(0)\subset {\mathbb R}^n\right) +O(\varepsilon^{n+1}).
\end{eqnarray}
As such, if we have two points $p_1$ and $p_2$ whose scalar curvatures are not equal, by taking  balls around each point which are sufficiently small, we see that the average value of $S$ in the first ball is essentially $S(p_1)$ whereas the average value in the second ball is $S(p_2)$.  Here, "sufficiently small" depends on the $C^1$ norm of the curvature, so I haven't tried to make it explicit.
The key point here is that in the first equation, the scalar curvature only appears in the second order term, which is why it is negligible in the volume estimate.
A: As a simple example, consider the curve $y=f(x)$, $x,y\in\mathbb{R}$, with measure given by the arclength $ds=(1+f'^2)^{1/2}dx$. The curvature is $\kappa=f''(1+f'^2)^{-3/2}$, for a uniform distribution we want $d\kappa=cds$, with $c>0$. This gives for the curve the differential equation
$$(1+f'(x))f'''(x)-3f'(x)f''(x)^2=c(1+f'(x))^3.$$
Here is a numerical solution for $c=1$.

A: Here is an example, too long for a comment.
Consider the torus, $[-\pi,\pi]^2$, with coordinates $t$ and $u$ and metric
\begin{pmatrix}
1 & 0\\
0 & (9+\sin t)^2
\end{pmatrix}
Then the scalar curvature is
$$\frac{2\sin t}{9+\sin t}$$
and the pdf of that scalar curvature is
$$\frac{18}{\pi(2-w)^2\sqrt{1+4w}\sqrt{1-5w}}\ \text{ on }\ \frac{-1}{4}\le w\le \frac15$$
or graphically

This is not uniform, but might be encouraging.
