# A concave maximization that is not supported on CVX

I try to solve a maximization problem using CVX. In its simplest form, I want to maximize

f(x,y)=y*h_b\left(\frac{x}{y}\right),

where h_b(\cdot) is the binary entropy function. In the context of CVX, it can be written as
$$f(x,y)=y*\left(entr\left(\frac{x}{y}\right)+entr\left(1-\frac{x}{y}\right)\right).$$
The conditions that I want to impose is as 1 \geq x \geq 0, 1 \geq y \geq 0, y \geq x.
While the function f(x,y) is a concave function, it’s not accepted by CVX. Do you have any suggestions regarding that? Thanks.

I’m not clear on what your function is.

y*log(x/y) can be expressed in CVX as -rel_entr(y,x), which is concave, and can be maximized in CVX…Is that what you want?

1 Like

By my back of the envelope calculation

f(x,y)=y\left(-\frac{x}{y}\log_2\frac{x}{y}-(1-\frac{x}{y})\log_2(1-\frac{x}{y})\right)=\\-x\log_2\frac{x}{y}-(y-x)\log_2\frac{y-x}{y}=\\\log_2(e)(-\textrm{rel_entr}(x,y)-\textrm{rel_entr}(y-x,y))

1 Like

Thanks. You are absoloutely right. I’m new to this tool, I didn’t know this function.

Thank you very much! This is exactly what I need.