Election Toy Model leads to a question of an interesting function if it exists

125 Views Asked by At

In Canada there is an election going on and I was pondering about a function in which you have the polling averages for the different parties $x_1, x_2, x_3... x_n$ and then a function $f(x_1), f(x_2)... f(x_n)$. I realized there are $4$ properties that this function must satisfy:

1) It must be in the domain $[0,1]$ and range $(0,1)$. This is true since the best probability is probably $99\%$ and you can't poll better than $100\%$

2) It must be monotonically increasing, since it doesn't make sense for your chance to get worse if you do better in the polls

3) It's must have that as $x \to 1, f(x) \to 1$ and on the same hand as $x \to 0, f(x) \to 0$

And the real tricky requirement

4) Given real numbers $x_1, x_2, x_3 ... x_n = 1$, it must also then be true that $f(x_1) + f(x_2) + f(x_3) + ... + f(x_n) = 1$. This makes sense because all the decided voter preferences combined must equal the whole of decided voters by the same token the sum of the probability of all parties winning must equal $100\%$ or $1$.

The only other requirement is that we disregard the solution $f(x) = x$ because polls are not linear to the likelihood of winning. A party with $80\%$ of the expected vote is more than $80\%$ likely to win.

I started with a logistic because it easily satisfies conditions $1, 2, 3$ but found it hard to get it fit condition $4$. Then thinking that a CDF might make things easier, I tried using the error function, finding that you can work backward and adjust the inflection point; this would be based on the inputs you have, leading it to be invariant with how tight the curve is, but that's lacking. I'm very curious if there is a curve that fits all those properties that comes out of thinking of this social phenomenon.

Love any suggestions or ideas, or proving that such a function is not possible. Thank you for reading.

2

There are 2 best solutions below

0
On

Suppose $f\colon [0,1]\to[0,1]$ is monotonic increasing and satisfies that whenever $x_1+x_2+\cdots+x_n=1$, we have $f(x_1)+f(x_2)+\cdots+f(x_n)=1$ (for all $n\geq 1$ an integer and non-negative reals $x_i$).

Setting $n=1$ we get $f(1)=1$ and setting $n=2$ we get $f(0)+f(1)=1$ so $f(0)=0$.

More generally, $n\cdot f(\frac1n)=1$, so $f(\frac1n)=\frac1n$.

Also $$\frac rn +(n-r)\frac1n=1.$$

Thus $$f(\frac rn) +(n-r)f(\frac1n)=1,$$ and $$f(\frac rn)=1-(n-r)\frac1n=\frac rn.$$

So $f(x)=x$ for any rational number $x\in [0,1]$.

Suppose $f(y)>y$ for some $y\in [0,1]$. Then we can find a rational number $x$ between $y$ and $f(y)$, so $x>y$ and $f(x)=x<f(y)$, contradicting that $f$ is monotonic increasing.

On the other hand suppose $f(y)<y$ for some $y\in [0,1]$. Then we can find a rational number $x$ between $y$ and $f(y)$, so $x<y$ and $f(x)=x>f(y)$, contradicting that $f$ is monotonic increasing.

We conclude that $f(y)=y$ for all $y\in [0,1]$.

8
On

INTRODUCTION

As I understand it you want the function $f$ to output the probability that party $i$ wins the election, given knowledge of the percentage $x_i$ of votes party $i$ received. Two things are not really clear at the moment:

a) Does the function you are looking for "know" the values of the other $x_j$?

and

b) Are the $x_i$ the actual percentages of votes in the true election, or just in some random sample the pollsters had access to?

This leaves four possible questions. (All four of which are very interesting so I upvoted your question nevertheless)

Case 1: the function $f$ knows all the $x_i$ and the $x_i$ are the actual election outcome. This case sounds trivial, but it is not. In this case the function $f$ is the procedure that translates the number of votes into an 'outcome' of the election. As you may know different countries use different procedures for this with vastly different outcomes, e.g. the case where a candidate wins the election with a minority of the popular votes is possible in some countries and not in others. Once we realize that the procedure of turning votes into outcomes apparently matters the question naturally arises if we can find the best procedure, and the way you approach this, by first thinking about what properties you want your function $f$ to have and then wonder if such an $f$ exist is a very good one, I think. However you might run into the problem of $f$ not existing as for example in Arrow's theorem, mentioned in the comments.

However I don't think Case 1 is what you are interested in since the procedures of processing votes in elections don't usually look like functions from $[0, 1]$ to $[0,1]$ and also in this case there is no randomness involved. We move on to case 2.

Case 2: $f$ has access to all $x_i$ but the $x_i$ reflect percentage of votes among a (hopefully representative) sample of the population and we want to make a statement of what happens when all votes are in. This is of course a very very very interesting problem that pollsters struggle with since time immortal. I suggest to search on google on how pollsters make predictions, there is a lot of literature about this.

Case 3: The $x_i$ are the actual election results but $f$ can see only $x_i$ and wants to commpute the probability of party $i$ winning without knowing what the other $x_j$ are (except that they must sum to $1 - x_i$. I will try and answer your question for this case, even though I believe that Case 4 is what you are actually after.

Case 4: Same as case 3, but now your $x_i$ is not the true election result but just an estimate made in a poll. This adds an extra source of uncertainty but I think a good way to approach this is first 'solve' case 3 and only after that think about how to bring this extra uncertainty into the function.

Hence I will concentrate on case 3:

ACTUAL ANSWER

I'll answer this question:

Knowing that there are $n$ numbers $x_1, \ldots, x_n$ that sum to 1, reflecting the fraction of votes parties $1, 2 , \ldots, n$ got, but knowing the precise value $x_i$ of only one of them, can we compute the probability that party $i$ wins the election?

To do that we must specify what we mean by winning. I opt for:

By 'party $i$ winning' we mean that $x_i > x_j$ for all $j \neq i$.

Finally we need to specify that we mean by probability. I opt for:

We model the tuple $(x_1, \ldots, x_n)$ as drawn from a uniform distribution on the $(n-1)$-simplex of $n$-tuples with non-negative values summing to 1.

If you don't like $n$-dimensional geometry there is an equivalent $1$-dimensional description:

We draw $n-1$ numbers $z_1, \ldots, z_{n-1}$ independently from a uniform distribution on $[0, 1]$. Next we relabel them $y_1, \ldots, y_{n-1}$ from smallest to largest and define $y_0 = 0, y_n = 1$. Finally we define, for $j = 1, \ldots, n$ the number $x_j$ by $x_j = y_j - y_{j-1}$

Okay so now we want to find a function $f$ that takes as input the value $x_i$ and outputs the probability that, given its value, this $x_i$ is the largest of all the $x_j$.

The first thing to notice is: since we defined our probability distribution in a way that is symmetric in $j$ the function $f$ does not depend on the value of $i$. That is good. You also assume that in the question.

We can similarly see that the function $f$ I propose here (if it exists, but of course it must exist since it outputs a probability for a well defined event and that exists as soon as we specify a probability distribution, which I just did) satisfies the four properties from your question.

At the same time we see that in order to specify the probability distribution we needed to first fix the number $n$. And as I point out in the comments: different values of $n$ lead to different functions $f$.

I will spell out the argument again. Suppose that $f$ would be the same for all $n$ then, by tkf answer, it would be the function $f(x) = x$. But as you point out in the question, the probability we are after does not have that property, for instance it satisfies $f(x) = 1$ for all $x > 1/2$.

Conclusion: different values of $n$ give rise to different functions $f$ and I will make this clear in the notation by writing $f_n$ for $f$.

Now can we actually compute the $f_n$?

Well we can certainly compute $f_2$ (as $f_1$ is too pathological we start here.) $f_2$ satisfies $f(x) = 0$ for $x \in [0, 1/2]$ and $f(x) = 1$ for $x \in (1/2, 1]$.

From $f_3$ onwards it becomes more interesting, but there is a very easy trick to solve this: recursion!

Suppose that by some dark magic we know what the function $f_{n-1}$ looks like, can we then compute the function $f_n$? Yes we can!

So let $x$ (as always) be the number we want to feed into $f_n$ and write, for shortness, $y$ for the number $1 - x$. We know. I already said that the value of $i$ (i.e. the name of the party that got a fraction $x$ of the votes) is immaterial, so let's assume that $i = n$ so that the fractions of votes of the other parties are labeled $x_1, \ldots, x_{n-1}$.

Now these add up to $y$ so let us write $x_1' = x_1/y, x_2' = x_2/y, \ldots$. The $x_j'$ are numbers that add up to 1 and have the interpretation of 'the fraction of the votes that did not go to party $n$ that party $j$ got'

Now there is the trick. The event that we are interested in, of $x_n$ being the largest of the numbers $x_1, \ldots, x_n$, is equivalent to the event of the largest of the numbers $x_1, \ldots, x_{n-1}$ being somewhere in the interval $[0, x)$. And the probability of that event is the sum (or rather integral) over all values $z \in [0, x)$ of the probability that $z$ is the value of the largest number in the set $\{x_1, \ldots, x_{n-1}\}$.

And for each individual $z$ we know this probability!

The event $z$ is the value of the largest number in the set $\{x_1, \ldots, x_{n-1}\}$ is equivalent to the event that $z' := z/y$ is the value of the largest number in the set $\{x_1', \ldots, x_{n-1}'\}$, and this probability equals $f_{n-1}(z')$ times the probability of $z'$ appearing at all in the set $\{x_1', \ldots, x_{n-1}\}$, and this latter probability is the infinitesimal quantity $(n−1)(n−2)(1−z′)^{n−3}dz′$ if $z' \leq 1$ and $0$ if $z' > 1$ (see tkf's comment below this answer).

Now to put everything together.

We want to integrate over $z$ running from $0$ to $x$ but also know that nothing interesting is going to happen when $z/y > 1$ so in practice we end up with an integral running from $0$ to $\min(x, y) = \min(x, 1-x)$. Following tkf's comment we don't convert back to $x$ but stick with $z'$ in the integral, so that the boundary $\min(x, 1-x)$ becomes $\min(\frac{x}{1-x}, 1)$.

This leads to the following recurrence relation:

$$f_n(x) = (n-1)(n-2) \int_0^{\min(\frac{x}{1-x}, 1)} f_{n-1}(z') (1 - z')^{n-3}dz'$$

So let's try and compute $f_3$ from $f_2$ using this formula (I leave higher up cases to you) and check if it satisfies the four constraints from your question.

In this case the $(1 - z')^{n-3}$ term becomes invisible and every thing simplifies. In this case it is easy to convert back to $x$ and $z$ and we get:

$$f_3(x) = \frac{n-1}{1-x} \int_0^{\min(x, 1-x)} f_{2}(\frac{z}{1-x}) dz$$

We first notice that $f_2(z/(1-x))$ equals $0$ for $z/(1-x) \leq 1/2$ so we are only really interested in the case where $z > (1 - x)/2$ and hence replace the lower bound of the integration by that number.

At the same time the upper bound stays at $\min(x, 1-x)$ and whenever $(1 - x)/2$ is greater then or equal to this number the whole integral will be zero. Of course $(1 - x)/2$ will never by greater than $1 - x$, but it can be greater than $x$. In fact it will be when $x \leq 1/3$.

So we find:

$$f_3(x) = 0 \textrm{ for } x \in [0, 1/3]$$

Of course this also makes perfect sense if you think about the interpretation.

Now for $x$ between $1/3$ and $1/2$ we have that the upper boundary of the integral is $x$. Have in this case that $(1-x)/2 < x$ and that for every $z \in [(1-x)/2, x]$ the number $z/(1-x)$ is greater than $((1-x)/2)/(1-x) = 1/2$ so that $f_2(z/(1-x)) = 1$ and the integral without the constant factor in front evaluates to $x - (1 - x)/2 = (3x - 1)/2$ so that (after multiplying this with the constant factor $2/(1-x)$ we end up with:

$$f_3(x) = 0 \textrm{ for } x \in [0, 1/3]$$ $$f_3(x) = (3x - 1)/(1-x) \textrm{ for } x \in [1/3, 1/2]$$ $$f_3(x) = 1 \textrm{ for } x \in (1/2, 1]$$

The last line I wrote based on the interpretation in terms of probabilities, but let's check it follows also from the recursion.

For $x$ in this interval the upper limit of the integral is $1 - x$ so the integral runs from $(1 - x)/2$ to $(1 - x)$. Again $z/(1-x) > 1/2$ by the same argument as before and hence the integral without the constant factor in front of it outputs $(1 - x)/2$. Now this is good news because we want to multiply this with the constant factor $2/(1-x)$ in front of the integral and this leads to the outcome 1 for all values of $x > 1/2$ as desired.

Of course the behavior in the interval $[1/3, 1/2]$ is most interesting. We can see that the function $(3x - 1)/(1-x)$ starts at 0 and ends at 1, making the full function $f_3$ continuous, but seeing that it is monotonous is already a bit tricky. I think the best course of action here is to use some fancy software to make a plot.

FINAL REMARKS

  1. Well, I must say I had a lot of fun solving this, but bringing in the extra uncertainty reflecting the case that $x_i$ is not the full election result but just a poll as in Case 4 above is gonna be very tricky I think.

  2. When I started this I thought that by making $f$ dependent on $n$ I could bypass tkf's objection against your constraint 4, but now I see that while my $f$'s crucially depend on $n$ they still don't satisfy it. This seems however a problem inherent to the constraint itself. You can find election results $x_1, x_2, x_3$ so that $x_3 > 1/2$ and hence must satisfy $f(x_3) = 1$ while at the same time $x_1$ and $x_2$ when considered on their own can have non-zero probability of being the largest of the three numbers, e.g. if $x_2 = 0.4$ then it is conceivable (from the perspective of someone who only knows that number) that $x_1$ and $x_3$ are both smaller, for instance both equal to $0.3$.

Of course when we know the full truth, that $x_1 = 0.55, x_2 = 0.4$ and $x_3 = 0.05$ get (even without knowing the precise formula for $f_3$) that the $f(x_i)$ add up to more than 1 because the $f(x_i)$ don't have knowledge of the other values $x_j$.

Put the other way around, the only way that we can have something like constraint 4 is if $f$ takes not just one number as input, but all $n$ of them (so if we are in what I call Cases 1 and 2 above). But this is a bit at odds with how you formulated the question, where $f$ takes only one input. Food for thought...