How can I calculate the median value? $$f(a,b) = a^b$$
Where $0\le a \le1$ and $0\le b \le1$ and either $a\ne0$ or $b\ne0$
How can I calculate the median value of $f$ ?
I can estimate it to be about 0.76536 by taking values along the interval.  This of course is not a mathematical answer, however. I'd like to know if you can calculate this algebraically. 


 A: For a continuous random variable $X$, the median is sometimes defined as the value $x$ such that $\Pr[X \le x] = \Pr[X > x]= \dfrac{1}{2}$. 
So, if we assume that $A,B$ are i.i.d. $\text{Uniform}[0,1]$, and we let $X = A^B$, then the median $x$ satisfies: 
$\dfrac{1}{2} = \Pr[X \ge x] = \Pr[A^B \ge x] = \Pr[B \le \dfrac{\ln x}{\ln A}] = \displaystyle\int_{0}^{1}\int_{0}^{\min\{1,\frac{\ln x}{\ln a}\}}\,db\,da$ $= \displaystyle\int_{0}^{1}\min\{1,\dfrac{\ln x}{\ln a}\}\,da = \int_{0}^{x}\dfrac{\ln x}{\ln a}\,da + \int_{x}^{1}1\,da = \text{Li}(x)\ln x + (1-x)$, 
where $\text{Li}(x) = \displaystyle\int_{0}^{x}\dfrac{\,dt}{\ln t}$ denotes the Logarithmic Integral. 
We can solve the equation $\text{Li}(x)\ln x + (1-x) = \dfrac{1}{2}$ numerically, which yields a median value of $x \approx 0.765352996676930...$. This is fairly close to what you got by discretizing the problem. 
A: I've never heard the term median applied to a function in this manner, so just to check we're on the same page, I think we are trying to find the value $m$ such that the set of $(a,b)$ with $0\le a \le 1$, $0 \le b \le 1$ and $a^b\le m$ has area exactly $1/2$.
Calculating areas suggests integration. We have to pick either $a$ or $b$ as the variable to integrate. Writing things in terms of $a$ we get $a \le \sqrt[b]{m}$, whereas writing things in terms of $b$ we get $b \le \log_a m$ (these both work because $\log$ and $\sqrt[b]{}$ are both order-preserving in this range).
We'll treat $m$ as a variable parameter and hopefully get an expression for the area in terms of $m$, and see if we can choose $m$ to get an answer of $1/2$.
I think the $a$ version looks slightly easier. So there are roughly three steps:


*

*Find out where $\sqrt[b]{m} > 1$, so that the $a \le 1$ constraint is the important one, and calculate this area as height $\times$ width.

*The rest of the time, the $0 \le a\le\sqrt[b]{m}$ constraint is the important one, so integrate $\sqrt[b]{m}$ over a suitable range and the area is what you get from that. (Note that $\sqrt[b]{m}$ is strictly positive, so this inequality is always satisfiable)

*Add the previous two results together.


Well, $\sqrt[b]{m} > 1$ exactly when $m > 1$, so that bit's actually easy: $m$ is the area of a subset of a set of size $1$, so $m \le 1$ and the $a \le 1$ constraint is never the important one. So we need to do:
\[\int_0^1 m^{1/b} \ \mathrm d b = \int_0^1 e^{\frac{1}{b}\log m}\ \mathrm db\]
This looks hard. The integrand doesn't actually exist when $b = 0$, but that's actually fine because for $m \le 1$ it has a clear limit as $b \to 0$, so it can be computed as an improper integral. Unfortunately I don't know how to continue, but I've written enough that I won't delete it now: I suppose this is a partial answer. (You could try again with writing things in terms of $b$, but I would guess you'll find it's still hard).
