# Train tickets - John C. Kirk

## Mar. 26th, 2007

### 03:36 pm - *Train tickets*

Here's one for the Oxford academics in our midst: a rather expensive train journey.

Go to:

http://www.nationalrail.co.uk/

and say that you want to travel from Oxford to Hawarden at 8am tomorrow. (I'm not sure how relevant the time is, and I think any day will do.) When it comes up with the results, click on the "Check fares" button. This produces the following results:

The cheapest available fare is: £179,769,313,486,231,570,000,000,00

Presumably this is a basic ticket, because there are no first class tickets available for that journey. Personally, I'd expect to at least be guaranteed a seat if I was spending a bazillion pounds on a ticket! (I haven't counted the zeros, so I'm not sure what the correct terminology is for that power of 10.)

Source: I swiped this from the "BackBytes" column in the latest issue of Computing, but I can't find the corresponding article on their website to link to directly. I've reported the problem to National Rail via their website, on the basis that it's a bit mean just to laugh at them, so you may get different results if you repeat this search later.

dwagon(Link)In other news, hehe :).

johnckirk(Link)bazzalisk(Link)To put this into perspective, a Googol is only 10^100, so this is roughly a googol of googols of googols of pounds.

Which is a big number.

Google tells me that there are only 8.87x10^49 atoms in the entire earth, and only 9x10^56 atoms in the sun, and the largest estimate for the number of atoms in the galaxy is only about 10^69 -- the highest estimate I can find for the number of atoms in the entire universe is only 10^81. still 20 orders of magnitude less than even one googol.

So ... if every atom in our universe was a universe itself, and every atom in each of those universes was a universe itself, and every atom in each of those was a universe, and then every atom in each of those universes was a pound coin (!?) then you would have enough money to buy this ticket.

johnckirk(Link)According to:

http://home.earthlink.net/~mrob/pub/math/numbers-14.html#l_p1_308_254

that value is equivalent to 2^1024 = 2^(2^10), so it is a bit more elegant than it looks.

I did like your explanation of atoms/coins; I hope they accept credit cards :)

shuripentu(Link)*would have been so very tempted to try to buy the ticket and see if it broke, say, the credit card company's computers*

*suspects it's a good thing that she doesn't have a credit card...*

johnckirk(Link)Actually, I got the following response from National Rail after I reported the problem:

You will notice that despite the fact that you are told this is the fare there are no tickets available on any services at any price and this is what causes the error.Based on that, I can guess the algorithm they're using:

1. Declare "cheapest fare" as a double.

2. Initialise cheapest fare to be the max value that can be stored in a double.

3. Loop through the list of available tickets. For each one:

* If this ticket is cheaper than the current cheapest fare, make the cheapest fare equal to this ticket.

4. Return cheapest fare.

This assumes that you have at least one ticket available, and breaks horribly if you don't :)

susannahf(Link)Yeah, right. I bet if you offered them a squillion pounds they'd sell you the train. In fact, you could probably charter a train for less than a million.

If there are no tickets, why tell you about the train? Are there any trains which have no walk-on tickets?