Image copyright Dan Hess

Some would say it's the magic of a festival - stumbling upon a random stage and accidentally discovering your new favourite band.

You could call it following your festival instinct.

But what if you ditched all that and did the complete opposite?

What if you took arguably the most nerdy thing in the world - statistics - and used it to try to have the best festival experience ever?

I'm talking planning. I'm talking hard numbers. I'm talking organised fun.

I consulted a stats expert, packed up a giant bar chart, and headed to 2000 Trees in Gloucestershire to find out.

And - just a warning - this article is incredibly, incredibly geeky.

Image copyright Gareth Bull Image caption A festival crowd: One of many situations in life that could benefit from more maths

What we did

Before the festival started, seven of my friends and I listened to all 116 bands on the line-up and rated them out of 10.

There were no strict rules on how much of each act you needed to listen to - but a very conservative estimate would be that it took us 45 hours. Each.

We then used the data to dictate our weekend.

And yes, if you're wondering, you can come along to festivals with us in future.

Image copyright Dan Hess Image caption Enter Shikari singer Rou Reynolds said our experiment should become the "industry standard". He may or may not have been on the gin at the time

Who to watch

It's a debate every festival-goer will be familiar with - who should we see next?

"You usually end up getting dragged around by the person with the strongest personality," says Dr Mark Taylor from the University of Sheffield.

He's spent his career researching music and statistics.

Image caption Dr Mark Taylor, pictured here in a hammock at Glastonbury, thinks our experiment is "dead interesting"

With his guidance we ran what's known as a k-means cluster analysis on our data. It's a way of taking absolutely loads of data and putting it into smaller groups or clusters.

In the real world, the technique is usually used in marketing to target people with adverts based on what other, similar people are into.

But in this case we used our scores to split us into four pairs based on who, statistically, had the most similar music tastes.

That person then had to spend the day with their statistically-chosen partner - and only watch bands together.

Image copyright Dan Hess Image caption It might look like they're in love, but they're actually statistically-chosen festival buddies (which in many ways is the same thing)

"The idea is to see whether - by providing a bunch of preferences in advance - you can use stats to work out who you have the most in common with," Mark explains.

"So while different people might do different things, you're with the person you have the most in common with and you end up having the best time."

That's the theory anyway.

But did it actually work? Strangely enough, yes. All eight of us agreed we had fewer arguments than usual about who to watch.

Stats - 1, Instinct - 0

Image copyright Joe Singh Image caption Turns out - stats or otherwise - there is no way to make a silent disco any better

Making friends

A huge part of any festival is the people you meet - so could we use stats to help our group make some desperately needed new friends?

Using data from Spotify and Facebook we were able to rank all the bands on the line-up from the most famous to the most obscure.

We then used the ratings to find out which of our group, on average, had given the highest scores to the most obscure bands.

In other words, the biggest hipster.

Assuming, like most hipsters, they would be irritatingly proud of their edgy music taste - we gave them a T-shirt to help them meet like-minded people.

Image copyright Dan Hess Image caption Somehow, this t-shirt didn't do its job

There was, unfortunately, less success here - our chosen hipster, George, said people avoided him. Even more than usual.

Stats - 1, Instinct - 1

Fetching food

It's another classic festival problem - when to duck out to the local supermarket and get supplies.

By dividing the weekend up into two-hour blocks, we were able to work out when, on average, we would miss fewest of our favourite bands.

Sadly, that turned out to be the two hours after we had just arrived and we didn't really need anything.

Not put off by the uselessness of what we'd done, we went anyway and bought a pizza

Stats - 1, Instinct - 2

Avoiding arguments

If you're going to last out a whole festival and stay happy, trying to avoid a big group bust-up is key.

We worked out the standard deviation for each band's scores - an average which showed us which acts divided the group the most.

We then simply avoided chatting about any of those bands after a few beers.

Image copyright Dan Hess Image caption Hellions were one of the most divisive bands on the line-up for our group

Come Monday morning - despite not having made any new friends - our group was still on good terms, so we're loosely chalking this one up as a win.

Stats - 2, Instinct - 2

'I'm all for this'

So, in conclusion - yes the pre-listening takes hundreds of hours of effort, but in some very minor ways it kind of works.

The main one being that, because we had pre-listened, we ended up discovering dozens of bands we absolutely loved - that otherwise we would most likely have missed (Sløtface, Caleb Harris and Mauwe being my own personal picks).

Could it ever catch on though?

You may also like

"I think it's a dead interesting experiment," Mark Taylor says - although he argues to make the stats more meaningful you would need more than eight people.

Image copyright Dan Hess Image caption A numbers game: Proudly displaying our bar chart at 2000 Trees. No idea who the guy on the far-right is, though.

"If you go to a lot of shows it's definitely worth playing around with different kinds of things to see how you get on and whether you enjoy yourself more.

"But I work with stats pretty much every day, I know quite a bit about the application of stats to music - and I've never tried anything like this and I probably never will."

Cheers Mark.

Image copyright Dan Hess Image caption Enter Shikari, who headlined on the Saturday night, were our group's highest rated band

But Rou Reynolds, the lead singer of Enter Shikari, was much more positive when we bumped into him backstage.

"I'm all for this. I think this should become an industry standard thing that everyone should have to do before a festival," he said.

"I'm all for science and being overly anal about everything - and that's what you guys have done."

Follow Newsbeat on Instagram, Facebook and Twitter.

Listen to Newsbeat live at 12:45 and 17:45 every weekday on BBC Radio 1 and 1Xtra - if you miss us you can listen back here.