Warren, I need your help

33 views
Skip to first unread message

parker friedland

unread,
Mar 28, 2018, 12:20:52 PM3/28/18
to The Center for Election Science
You're a mathematician, and I have an optimization problem that I need help with.

Consider the following quality function:

Q = Va × ln(A) + Vb × ln(B) + Vc × ln(C) + Vab × ln(A+B) + Vac × ln(A+C) + Vbc × ln(B+C)

As well as the following conditions:

A >= 0
B >= 0
C >= 0
A + B + C = 1

Is it possible to find relatively simple equations that define the most optimal combination of A, B, and C, (that produces the highest value of Q while still satisfying all of the conditions) in terms of Va, Vb, Vc, Vab, Vac, and Vc. And if it is possible, can you do it?

To put it simply, can you define the following functions:

A(Va, Vb, Vc, Vab, Vac, Vbc)
B(Va, Vb, Vc, Vab, Vac, Vbc)
C(Va, Vb, Vc, Vab, Vac, Vbc)


in terms of polynomial, summation, integrals, etc. instead of complex computer logic.

Warren D Smith

unread,
Mar 28, 2018, 12:49:02 PM3/28/18
to electio...@googlegroups.com
On 3/28/18, parker friedland <parkerf...@gmail.com> wrote:
> You're a mathematician, and I have an optimization problem that I need help
> with.
>
> Consider the following quality function:
>
> Q = Va × ln(A) + Vb × ln(B) + Vc × ln(C) + Vab × ln(A+B) + Vac × ln(A+C) +
> Vbc × ln(B+C)
>
> As well as the following conditions:
>
> A >= 0
> B >= 0
> C >= 0
> A + B + C = 1
>
> Is it possible to find relatively simple equations that define the most
> optimal combination of A, B, and C, (that produces the highest value of Q
> while still satisfying all of the conditions) in terms of Va, Vb, Vc, Vab,
> Vac, and Vc. And if it is possible, can you do it?

--
First of all, if VA, Vb, Vc, Vab, Vbc, Vac all are nonnegative,
then your Q(A,B,C) function will be concave-down and
the region A+B+C=1 with A,B,C>=0 is a convex region (equilateral
triangle in fact) and hence then THERE EXISTS A UNIQUE MAXIMUM
of Q within the region.

Second, to find it, we want the gradient(Q) vector
to be parallel to (1,1,1). Equivalently, at the optimum
we want the following three quantities all to be equal
dQ/dA, dQ/dB, and dQ/dC, with d denoting partial derivative,
which are:

Va/A + Vab/(A+B) + Vac/(A+C)

Vb/B + Vab/(A+B) + Vbc/(B+C)

and

Vc/C + Vac/(A+C) + Vbc/(B+C)

You need to solve for A,B,C so all those 3 things are equal and A+B+C=1.
That is 3 simultaneous nonlinear equations in 3 unknowns. They can all be made
polynomials by multiplying all by A*B*C*(A+B)*(A+C)*(B+C),
and then the polynomials have degrees 5 or less. This is not the sort
of thing we can expect to solve in close form. You cannot even solve
a univariate quintic in close form, much less a 3-variable quintic system.
You will need to solve it numerically.

If you solve them and the solution is INTERIOR to the equilateral triangle
(i.e. has A>0, B>0, C>0) it should be the unique answer. If
exterior or on its boundary, then you have to deal with more of a mess...
the optimum then will lie on one of the 3 edges of the triangle and
can be found by a 1-dimensional optimizer...


--
Warren D. Smith
http://RangeVoting.org <-- add your endorsement (by clicking
"endorse" as 1st step)

Nevin Brackett-Rozinsky

unread,
Mar 28, 2018, 2:07:52 PM3/28/18
to The Center for Election Science
If there is a solution with all 3 of A, B, and C non-zero:

1. Substitute (1-A-B) for C, to get Q in terms of A and B alone.
2. Calculate dQ/dA and set it equal to 0.
3. Rearrange (2) into a polynomial in B.
4. Solve (3) for B (note: assume B≠0.)
5. Calculate dQ/dB and set it equal to 0.
6. Substitute (4) into (5).
7. Rearrange (6) into a polynomial in A.
8. Solve (7) for A (note: assume A≠0.)
9. Substitute (8) into (4) to get B.
10. You now have A, B, and C = 1-A-B.

If any of them are outside the range (0, 1) then the assumption that they were all nonzero is incorrect.

Nevin

Warren D Smith

unread,
Mar 28, 2018, 7:38:08 PM3/28/18
to electio...@googlegroups.com
recap:

Va/A + Vab/(A+B) + Vac/(A+C)

Vb/B + Vab/(A+B) + Vbc/(B+C)

Vc/C + Vac/(A+C) + Vbc/(B+C)

You need to solve for A,B,C so all those 3 things are equal and A+B+C=1.
That is 3 simultaneous nonlinear equations in 3 unknowns.

Just for giggles, type this line into wolframalpha.com

Solve[ {1==a+b+c,
x/a+w/(a+b)+v/(a+c)==y/b+w/(a+b)+u/(b+c)==z/c+v/(a+c)+u/(b+c)},
{a,b,c} ]

when I did it, nothing good happened. Not a huge surprise since I already said
this system probably cannot be solved in close form.
However if I enter specific nonnegative
numbers for u,v,w,x,y,z then voila

Solve[ {1==a+b+c,
2/a+7/(a+b)+11/(a+c)==3/b+7/(a+b)+6/(b+c)==4/c+11/(a+c)+6/(b+c)},
{a,b,c} ]

solves it to a ton of digits of accuracy? Well, it does something,
I'm not sure what.
Click "more roots" and maybe some combination of the garbage it prints, can
be assembled into a valid solution.

Nevin Brackett-Rozinsky

unread,
Mar 28, 2018, 7:44:38 PM3/28/18
to The Center for Election Science
Er, just realized step 7 is not actually a polynomial since there are square roots from solving the quadratic in step 3. It’s still a function of A alone though, hence easily optimized.

Nevin

parker friedland

unread,
Mar 28, 2018, 8:17:29 PM3/28/18
to The Center for Election Science
> First of all, if VA, Vb, Vc, Vab, Vbc, Vac all are nonnegative,
> then your Q(A,B,C) function will be concave-down and
> the region   A+B+C=1 with A,B,C>=0 is a convex region (equilateral
> triangle in fact) and hence then THERE EXISTS A UNIQUE MAXIMUM
> of Q within the region.

Well, you were right that all of these terms are all supposed to be positive.


> This is not the sort of thing we can expect to solve in close form.

If by closed form, you mean that it's impossible to define A, B, and C using mathematical equations (summations, integrals, etc), then that was what I needed to know.

Thanks for all the help!

Warren D Smith

unread,
Mar 28, 2018, 8:19:33 PM3/28/18
to electio...@googlegroups.com
>> This is not the sort of thing we can expect to solve in close form.
>
> If by closed form, you mean that it's impossible to define A, B, and C
> using mathematical equations (summations, integrals, etc), then that was
> what I needed to know.
>
> Thanks for all the help!

--well, we can solve it in the sense we ought to be able to
write down an iteration which converges to the unique
Reply all
Reply to author
Forward
0 new messages