Pick numbers. There we are.

We're having the accumulation of salaries.

So, highlight this column here.

So, we're actually comparing the sums of

these and looking at that to detail, the first day,

the income of plan B overtakes plan A

is when you earn 8,191 against 5,212.

So, the day before,

we're still making more money on the first payment plan.

But we are ahead from the 13th day onwards.

Why am I talking about that?

We are going to pay attention to sequences of earnings and sums of earnings.

But let's look at another example.

I've got another story for you.

The inventor of the game of chess,

this was before the seventh century in India,

presented a game to the emperor.

Now, having enjoyed the new game the emperor praised

the inventor and offered a generous reward.

"Whatever you want!"

She asked for one grain of rice for the first square of the board.

Two for the second square,

four grains of rice for the third square,

eight for the next, and so on.

The Emperor approved the payment,

probably dismissing it as a humble request from

this inventor and not giving it much more thought.

Well, in the end it's just a few grains of rice for an emperor.

The Treasurer in charge of the transaction later

returned to the emperor informing them the reward

would add up to more rice than they could ever, ever have ground.

What is going on? You know the chessboard is eight by eight.

So, we have 64 squares,

surely adding one plus two,

plus four, plus eight,

all the way to two to the power of 63 grains of rice.

That can't be that much can it?

Now, if you want you can go and find out how much do we produce in

the world in rice in terms of grains but I leave you to that.

I have another problem for you.

The traveling maths presenter problem.

I'm taking bookings for touring with my new show.

Here's my schedule for the next summer together with a travel costs.

So, initially I'm going to London,

Manchester and Edinburgh and I need to travel between all these cities

and London to Manchester I'm seeing that there's a £100 fare,

London to Edinburgh a £150 fare,

Manchester to London yes trains in Britain is a little bit more expensive,

it's a £120, and Manchester the Edinburgh a bargain 50 quid,

Edinburgh to London a £130,

Edinburgh to Manchester £50.

So, this is what I'm expected to spend so far now.

I have to visit all the cities and come back to the starting point.

Of course, in the cheapest way possible.

But no cities are to be repeated apart from the start and end.

I do want to end up at home.

We can attack the problem by trying out all the possible trips in my tour.

Could do London to Manchester to Edinburgh of course back to London.

London, Edinburgh, Manchester, back to London.

Manchester, London, Edinburgh, and so on.

These six trips to check and surely,

we can add up the totals and calculate the cheapest trip doesn't sound difficult.

But it turns out,

I just got another booking coming in.

I'm going to Cardiff here's my updated table with my costs.

Now, with this extra city,

the trips I'm to make I'm to travel,

I could do Cardiff,

London, Manchester, Edinburgh back to Cardiff.

Cardiff, London, Edinburgh, Manchester back to Cardiff and so on.

So, I could just put a Cardiff at the beginning of all the trips I've studied before,

that gives me six of them.

But I could go to Cardiff seconds could I?

Here's the list. Or I could go to Cardiff in the third place,

on the fourth place and so on.

How many trips do I have now with this extra city?

It turns out, it's 24.

So, within cities, six trips that I can consider.

With four cities, we now have 24 trips.

How many trips for n cities?

I'm expecting a big tour.

The trips to consider with one more city is the

same as the trips I had with my old number of cities times the new number.

So, trips of n plus one cities is the same as n times the trips with n cities.

So, trips on three cities is six,

trips on four cities is four times trips of three,

which is four times six to 24,

trips with five cities is five times of trips of for which we've just done,

it's five times 24 which is a 120.

So, I can expand this as the trips for n cities as

n times n minus one times n minus two times a smaller,

smaller number times three times two.

We could analyze the costs of all these trips could we?

But how long does it take to do that job?

To cost and analyze all these possibilities as the number of cities increases.

As I get more and more bookings,

this approach to finding the cheapest tour becomes unmanageable.

I hear you cry.

Surely, we can use computers.