Eurovision, Monte-Carlo analysis, and the detection of tactical voting

Eurovision, Monte-Carlo analysis, and the detection of tactical votingHow Eurovision has become more tactical, yet more balanced, over the years.

Gareth WalkerBlockedUnblockFollowFollowingMay 17An ode to EurovisionFor those of you that don’t know, and I’m betting that’s a fair few of you outside of Europe, the Eurovision song contest is an annual music competition where a (loosely) confederated group of (mostly) European countries join each other on live TV to pitch each other a winning song.

In X-Factor style, the competition is decided by voter phone-in.

Each country allocates points to their top 10 choices, the points ranging from [1,2,3,4,5,6,7,8,10,12].

Non-zero point values can only be given once (e.


France can only give one country its ‘12’ points).

Eurovision has been a guilty pleasure of mine for a long time.

I grew up as a third culture kid across Africa, Europe, and Asia.

Eurovision’s bizarre mash-up of pop culture, its liberal vibe of acceptance and openness, combined with its down to earth helping of rivalries, geopolitics, and whispers of conspiracy, has always spoken to me.

Beyond sheer entertainment value, I’ve always taken it to be a fairly representative simulation of most attempts at multilateralism: worthy, messy, inevitably strategic.

Not only that, it’s ripe for data science.

And it turns out I’m not the only one who thinks so; predicting the results of the contest was the first ever competition Kaggle put together.

And even more fortunately, the good people at Data World, have maintained an up-to-date data set of all votes issued and received by country for the history of the competition.

The research question: is strategic voting getting ‘worse’?To carry on with the multilateral analogy for just a little longer till I let it die, Eurovision is not without its factions and detractors.

Recent years have seen increasingly loud grumbling (mostly from Western European states) that the competition is now essentially a game of strategic voting blocks (consisting broadly of Western Europe and Eastern Europe), in which Eastern Europe’s sheer volume of small Post-Soviet states means that traditional winners from way back when (see Ireland, still the record holder of ‘most wins’ since the show started in the 1970s), have little chance of winning.

This line of argument has even lead to a review of the points allocation methods in 2006, which introduced a panel of judges (assumed to be more ‘objective’ than the popular vote) to represent 50% of the point awarding criteria.

The questions which emerge are:1.

) Does strategic voting happen in Eurovision?2.

) Has the volume of strategic voting increased over the years?Git hub code base can be found here: https://github.

com/InternetGareth/EuroVisionExploring the dataBest take a look at the structure of the data before diving in.

First of all, it looks like the data includes votes from not only the finals, but from multiple rounds of the competition (quarter-finals, semi-finals, etc).

This is worth remembering in later analysis.

Imported DataFrameA second issue to just keep in mind is that, for all years, but in particular if the analysis is restricted to finals only, the number and values for countries will change with each year.

The total countries in the final changes each yearFinally, just to confirm, the data captures the somewhat arbitrary point scheme for the competition: {0, 1–8, 10, 12 }Network analysisThe first approach I took was to import all the data into the Networkx package in Python and apply some basic community detection.

The dataframe of votes can be represented as a network in which nodes are countries in the competition, and the edges are votes given and received between countries.

Given these parameters, we can consider this network to be bi-directional and weighted.

Community detectionOnce the data is in this format, I decided to try out some community detection to see if there were indeed some geography-based voting blocks.

In this instance, I have used Louvain Modularity as my detection algorithm.

Essentially this algorithm attempts to optimize the number of communities and their members against a criteria of maximizing the ratio of density of edges within a ‘community’ to those outside a ‘community’.

Modularity: Objective function to maximize in Louvain community detection Source: https://en.


org/wiki/Louvain_ModularityHere is the output for an analysis of all stages of the competition (semi-finals, finals etc) for the last 5 years of voting (2013–2018):Community detection for 2013–2018, all competition stagesIt looks like there is some truth to the perception that there is an East versus West voting block going on.

The two largest communities are:Green: predominantly Western/Northern European states.

Blue: predominantly Balkan/Eastern European states.

Detecting changes in communities using Jaccard IndexSo we have some evidence that over the last few years, countries have indeed tended to vote as a block.

My next step was to try to think of a way of tracing if those blocks change over time.

I elected to use a Jaccard Index to compare how consistent communities remain over time.

The Jaccard index is pretty simple metric: it is the intersection of two sets over their union : (A∩B)/A∪B.

And for something as straight forwards as a list of countries, gives me a good idea of how similar those communities are over time.

Specifically, I coded up an algorithm which:Detected communities for each year (based on the total votes between all countries in that year and 3 years prior)For each community, match it to its ‘best’ match from last year (the community with the highest Jaccard when compared)For all matches, calculated a mean average weighted Jaccard score for that yearThis value will then tell me the degree to which voting blocks / communities have remained consistent over time and if there are any years when there have been large changes in voting behavior.

The results are below.

Note that, because the Lauvain algorithm optimizes for speed through finding local solutions, it will produce slightly different results for each run.

In order to address this, the detection is repeated 50 times for each year and a 95% CI is given around each weighted average Jaccard Index:Weighted average Jaccard Index between detected voting communities (current year compared to previous year)What this is telling us is that for the years of 2004-2006, something happened to radically ‘shake up’ the voting communities which operate in the competition.

As it turns out, there is a good explanation for this; prior to 2004, only countries that made it to the finals could then vote on a winner.

After 2004, this was altered to allow countries who didn’t make it to the finals to nevertheless vote.

So it seems we are part of the way there in explaining strategic voting: by opening the competition voting up to countries who have dropped out, the voting ‘communities’ have changed markedly since 2004.

Looking deeper into strategic voting using Monte Carlo analysisI now know that there are distinct communities of voters, and that they went through a re-shuffling in 2004.

However for voting to be truly ‘strategic’ , one would expect it to be reciprocal : i.


countries who vote for each other all the time.

Fortunately, there is a great paper by Derek Gatherer (2004) which describes a method for detecting strategic votes based on a Monte-Carlo approach.

The method takes the following steps:Choose a time period (e.


5 years)2.

For each year, calculate the non-biased probability density function for all possible points given by a country to another country.

This is relatively easy: all non-zero point categories will each have a 1 / (N-1) chance, where N is the number of countries voting.

The zero point category will have a (N-10)/N chance.

Where 10 is the number of non-zero point categories.

Example probability distribution for votes given in year 20003.

Run a Monte-Carlo simulation of votes across those years to calculate the probability distribution of total votes given to a single country, by a single country, for that time period.

Again, this is just a mater of randomly sampling and combining total points from each year’s distribution.

Below is an example of 2000 runs simulation for the period of 2000 to 2005.

As we would expect, it is heavily skewed to zero as most countries won’t make the cut to win points.

On average, you can expect to receive a total of about 2.

3 votes from any other country over the duration of 2000 to 2005.

Frequency distribution of total votes given by a country to another county: Mont Carlo Simulation for years 2000 to 20054.

Compare to actual voting patterns: Where the actual votes given fulls within the 5% percentile of the distribution, voting is considered ‘favouritism’.

Where this is reciprocated by favouritism from the other country, voting is considered ‘strategic’.

ResultsUsing the above method I was able to detect strategic voting between countries, and their changes over the years.

The graph below shows (i) the normalized rate of deal-making (strategic relationships), defined as (total number of deals / total possible deals) and (i) the percentage countries in strategic relationships.

Essentially these are two measures for the same trend, but it is useful to have them separate to consider .

% Countries in deals , and the rate of deal makingLooking more closely at the rate of deal making on its own axis, we can see more clearly that this has increased substantially over time (and is measuring a very similar trend to % of countries in a deal):So we now know that not only have voting communities changed significantly over the years, but reciprocal voting (i.


strategic voting) also appears to be on the increase.

So were the Western States right to complain?.Well….

yes and no….

Mapping voting communitiesSo who are these strategic alliances?.It’s worth mapping out some samples to give us an idea of who is teaming up with whom.

Here are strategic alliances detected using the Monte-Carlo approach, in 5 year increments:1995 to 2000Cyprus and Greece have each other’s back in the late 1990sAs do the infamous Scandinavian / Northern voting blockThe beginnings of the eastern voting block emerge2000 to 2005The Balkans get strategic: an opening up of voter eligibility increases volume of strategic alliances, where regional solidarity encourages the growth of a new voting block in Eastern Europe.

And some countries forget to join the party….

2005 to 2010The web of alliances gets more complex as the years go by, but is still defined by centers in Scandinavia, Eastern Europe, and the BalkansAnd the U.


wonders why it never wins any more…ConclusionsThe 2004 voting rule change significantly impacted the competition: the competition has grown more strategic, but this is probably more due to the revision of voting rules in 2004 which had the impact of bringing more regional solidarity into the voting (rather than any conspiratorial effort on the part of Eastern countries!).

Strategic voting has increased: there has been an increase in strategic voting across the years, and this was on an upwards trend prior to the 2004 revision of rules.

It also doesn't seem to have been affected by the effort to introduce ‘objective’ judging panels.

However its more a matter of other countries playing the West at its own game: it is worth noting that the countries who complain about this (mostly older western European contestant) invented the game of strategic voting: in particular the Scandinavian voting block, but also the UK-Malta-Ireland connection.

I will leave you with one final thought on the many lessons of Eurovision, which feels pertinent at the moment.

It is worth remembering that one can often see the fall in relative power of some states as not an absolute ‘decline’ in power, but as a success story of the rise of the rest of the world.


. More details

Leave a Reply