Is there a way to generally transform a weighted arithmetic mean to a weighted geometric mean?

I was wondering under what general conditions and how it's possible to transform a weighted arithmetic mean to a weighted geometric mean.

Assume there are positive weights $a_1,\dots,a_n$ that sum up to $1$ (i.e. $a_1+...+a_n=1$ and $a_i\geq0$ $\forall i\in\{1,\dots,n\}$) such that: $$y=\sum_{1\leq i\leq n}a_i\cdot x_i$$ Under what conditions and how can positive weights $g_1,\dots,g_n$ that also sum up to $1$ be calculated such that: $$y=\prod_{1\leq i\leq n}x_i^{g_i}$$

Addendum: The above formulation of the question has to be specified a little bit further: The famous theorem on the (in)equality of weighted arithmetic and geometric means states: Given positive weights $w_1,\dots,w_n$ that sum up to one it holds that: For all positive $x_1,\dots,x_n$:

$$\sum\limits_{i=1}^nw_i\cdot x_i\geq\prod\limits_{i=1}^nx_i^{w_i}$$

... with equality iff $x_1=\dots=x_n$. Note that the weights are fixed here.

Now, I am interested in a result on varying the weights, especially I am interested whether a statement of the following form holds:

$\forall x_1\in(0,1],\dots,x_n\in(0,1]$
$\forall a_1\in[0,1],\dots,a_n\in[0,1]$ ($a_1+\dots+a_n=1$)
$\exists g_1\in[0,1],\dots,g_n\in[0,1]$ ($g_1+\dots+g_n=1$)
such that the equivalence holds -- for short:

$$\forall x\forall a\exists g\sum\limits_{i=1}^na_i\cdot x_i=\prod\limits_{i=1}^nx_i^{g_i}~~\text{where for the x_is,a_is,g_is hold the restrictions as stated above}$$

And if so, is there a way to calculate solutions for the $g_i$s with Mathlab, Maple, Wolfram etc.? If not, which restrictions on the $a_i$s and/or the $x_i$s are necessary?

I'd be very happy for any hints.

Thanks a lot, Christian

$$\log y=\sum_{i=1}^n g_i\log x_i=\log\sum_{i=1}^n a_ix_i.$$
$$\sum_{i=1}^n g_i=1$$
this is a linear system of $2$ equations in $n$ unknowns, which is $n-2$ times indeterminate.
• @Christian: set $n-2$ parameters $g_i$ arbitrarily and solve for the two remaining ones. – Yves Daoust Sep 11 '17 at 10:29