Riddler Express, July 6 2018

So, last week’s effort was, err, not quite 100%. I feel better about this week’s Express puzzle.

You are a delivery person for the finest peanut butter and jelly sandwich restaurant in Riddler City. City streets are laid out in a grid, and your restaurant is on the corner of 20th Street and Avenue F. The city has 61 east-west streets, numbered 1st to 61st, and 21 north-south avenues, named A to U.

While traveling on a given street or avenue, you can drive at 20 mph, and the blocks are all 0.1 miles long. The exception is Avenue U, also known as the Ultra-Speed Trafficway, upon which you can drive at 200 mph. (You don’t need to worry about slowing down for traffic or turns.)

What are the parts of the map for which it’s helpful to use the Ultra for your deliveries, assuming you always start at 20th and F?

This is the most Excel-friendly Classic I can remember, and I pretty much think in Excel, so that’s how I tackled this one.

Read more

Riddler Express, June 29 2018

EDIT2: Even my second attempt was wrong. See the comments.

EDIT: I’ve got this wrong – see the bottom of the post.

This one is titled, “What Are The Odds World Cup Teams Play Each Other Twice?”. The question is simple:

Assuming we don’t know anything about the strengths of the teams in the tournament, what are the chances that any pair of teams in a 32-team World Cup plays each other twice?

I’m pretty confident I’ve got this one, so here goes!

The chance of any two teams meeting each other is the product of a lot of independent events. These events being independent means that

What are the events? Or to put it another way, what needs to happen for the two teams to meet each other twice?

Firstly, to meet in the first round, they must be in the same group.

Then, to have any chance of meeting again, the two teams must finish first and second in the group.

Then, both teams must win their second round matches, and their quarter-final matches.

Lastly, both teams must achieve the same result in the semi-final match: either both must win their semi-finals, or both must lose. (If one team loses and the other wins, then one team will go to the final, and the other to the third-place play-off.)

If those are the things that need to happen, what are the chances of each of them happening?

Being in the same group: there are 32 spots in the World Cup, in eight groups of four. Whichever group the first team is in, there are then 31 spots left, and three of them are in the same group as the first team. So the chances of this are 331.

Finishing first and second in the group: this is related to the question, “how many ways can you choose two things out of a set of four different things?”, also called four choose two, or 4C2. There are two related ways of thinking about this:

  1. Call the teams in the first round group A, B, C, and D. We want our pair of teams to win. We can say that A and B are the teams we care about, but it doesn’t matter which of the four letters we pick. How many different possible winning pairs are there? The pairs are easy to list: AB, AC, AD, BC, BD, CD. The teams A and B only appear together once in that list of six, so the chances of them coming first and second are 16.
  2. Let’s say again, that the teams we care about are A and B. How many different possible results are there for the whole group? We can count them, starting with first place: there are four possibilities for the team in first, then there are three possible teams left that can come second, and two left that can come third. If we know the teams in first, second, and third place, then there’s no question about which team is fourth – it must be the team that is left. So the number of possibilities are 4 × 3 × 2 = 24.  What are those combinations?

    All 24 combinations are here, and you can see that the four combinations in which A and B are the top two teams have been underlined. Four possible results out of 24 = 16. That’s the same as the answer that we got through the first method, thankfully.

Both teams win their second round and quarter-final matches: this is a total of four matches which all need to be won. Since we don’t know the strength of any of the teams, we can say that each of our teams has a 50% chance of winning any match it is in. 50% is a probability of 12, so the chance of all four matches being won is 12 × 12 × 12 × 12 = (12)4 = 116.

Both teams get the same result in their semi-finals: there are four possible results in the semi-finals (team A wins or loses, at the same time as team B independently wins or loses). Two of these four results are good enough: two out of four = 24 = 12.

Putting it all together: the combined chance of all of these events happening is just the chance of each of them happening individually multiplied together:

331 × 16 × 116 × 12 = 131 × 12 × 116 × 12 = 11984

So, not very likely!

That’s the Riddler Express for this week. Riddler Classic is still stumping me.

Edit: a friend pointed out that I have misinterpreted the question:

…what are the chances that any pair of teams in a 32-team World Cup plays each other twice?

I have considered “any pair” to mean “any given pair” – answering the question, “If you pick two qualified teams before the draw for first round groups even happens, what are the chances that your pair of teams will play each other twice?” But “any pair” means “any pair at all”, not “any pair you pick before the tournament starts.” So the question actually means, “After the end of the tournament, what is the chance that at least one pair of teams will have played each other twice?”

I think I can answer that as well:

At the end of the first round, there are 16 teams left in the competition; eight pairs, where each pair played each other in the first round, and the two teams came first and second in their group.

Each pair has eight teams in the top half of the bracket, and eight teams in the bottom half of the bracket. Regardless of what happens in the bottom half of the bracket, four teams go out in the top half of the bracket after the second round matches, and two more go out after the quarter-finals. Two  teams are left in the top half of the bracket, after the semi-final: one in the final, and one in the play-off.

Now in the bottom half of the bracket, there are the other halves of all eight pairs. Only two of those eight still have a paired team in the top half of the bracket – for the other six, their paired team is already out.

So two teams in the bottom of the bracket have a chance to play again against a team they played in the first round. To do that, either of them would have to win their second round and quarter-final match (50% × 50% = 25% chance), and then get the same result in the semi-final that their paired team in the top half of the bracket did (another 50% chance, for a total of 50% * 25% = 12·5% = 18 for each of the two teams).

What’s the chance that at least one of those two teams makes it to play their other pair in the final or play-off? The chance that a particular one of them makes it is 18, so the chance that a particular team doesn’t make it is 78. The chance that neither team makes it is 78 × 78 = (78)2 = 4964. So the chance that at least one team plays another team twice is 1 – 4964 = 1564.

Godwin’s Law is Everywhere

I am strongly pro-Remain, but this is a bit much:

I think the Leavers lied, misrepresented, and cheated. But I don’t think anyone lied about the number of ballots cast in the referendum, and I don’t think May is looking to secure herself in power, annex her neighbours, and start a programme of genocide.

This is not a helpful comparison. Parliament can do what it likes, regardless of May’s preferences. While I don’t like the first-past-the-post method we use to elect the Commons, it is still democratic. Unlike the referendum mentioned in the tweet, MPs typically face meaningful opposition to win their seats.

The only part of this I can really get behind is the implied criticism of the idea that “the will of the people” is already known to the leader, and it must be carried out at all costs.

As Godwin said, cheap Nazi comparisons stop people thinking hard about the Holocaust.

The NHS is a World Unto Itself

My position when writing: unclear, but I’m not particularly a fan of Jeremy Hunt.

Apparent argument: some things are going wrong in the NHS.


What’s right with this? Well, I assume the claims are factually correct

What’s wrong with this? Two main things – it’s context free, and it doesn’t tell me why I should care about those particular measures.

As the NHS changes, facts and figures about it will change. Without knowing the story behind a change, it’s difficult to know if the facts are part of good news or bad news. The facts given by David Lammy’s tweet could be be part of good or neutral changes. I don’t know that they are, but consider:

  • “the number of people waiting over two weeks for urgent cancer treatment has more than doubled” – this depends on how the number of those people is measured. How do we decide who has an urgent need for cancer treatment? If our detection systems are better now, but our treatment capacity hasn’t changed, then the queue could be longer without any decrease in the amount of treatment.
  • “the NHS has lost 7000 beds” – this would be fine, if the need for beds had also decreased. So if treatment was better, and patients had shorter stays in hospital, or if more conditions were being treated without a hospital admission, then the number of beds could decrease without any negative consequences.
  • “the number of people waiting more than four hours in A&E is up 842%” – okay, it’s difficult to see how this could be a good thing! But perhaps this is partly explained by there being more patients overall. If the number of patients has doubled, then that cuts in half the size of the increase that needs to be explained by something else, such as incompetence or relative underfunding.

Similarly, for some of the items in the StandwithNHS tweet:

  • “72 NHS Walk In Centres Closed/Downgraded”, “61 Ambulance Stations Closed” – the number of closures or downgradings are not that useful by themselves, because it’s not clear that the numbers are net (effective) or total. It’s possible that 100 new ambulance stations were opened, 61 were closed, and we now have 39 more overall. Maybe only 50 were opened, but that still means there are only 11 less than there were before, rather than the 61 mentioned.
  • “9.1% NHS funding cut per patient” – maybe drugs are cheaper, or more effective. Maybe we treat more patients without admitting them. Maybe we treat more patients with drugs than with surgery. Maybe this includes patients who called NHS Direct. There are all kinds of ways that funding levels could be lower without anything being worse.

Now look at the good news, according to the Conservatives’ own web site:

This looks like good news, but it can still hide poor service:

  • “We have increased health funding to a record level – so people get the care they need.” – it could still be falling when inflation is taken into account.
  • “We are investing more in mental health than ever before – transforming mental health services.” – this isn’t inflation-adjusted either. It’s impossible to know what is meant by “transforming”.
  • “There are more doctors and nurses looking after patients.” – there could still be less than are needed.
  • “Our healthcare system has been ranked the best healthcare system of 11 wealthy countries by The Commonwealth Fund.” – the Fund’s criteria may not be the same as British people’s criteria. The NHS’s current performance could be worse than it was in the past.
  • “Cancer survival rates at a record high.” – performance may simply have moved from “very bad” to “bad”. It may still be possible to do much better.

There are thousands of possible ways of describing the NHS’s performance. Most of them don’t tell you much, unless you understand their context. Because the NHS is such a large organisation, and is constantly changing, it’s perfectly possible for some parts of it to get better while other parts get worse.

The NHS is supposed to keep people healthy. It is effective if the people it treats are healthier than they would have been otherwise, and it is efficient if it doesn’t cost too much to do that. (That cost can be in cash, time, or something else).

Discussion about the number of hospital beds, the number of nurses, or the number of ambulance stations, is beside the point. Changes to those numbers can help or hurt. But we don’t care how many ambulance stations there are, we care about how many people are saved by ambulances arriving quickly. We don’t care how many nurses there are, we care about how many patients don’t get good enough nursing care.

The questions we should be asking are about outcomes, not resource levels. Are patients are receiving high-quality care? Is the NHS saving the highest possible number of Quality-Adjusted Life Years? Is this being done for the lowest cost consistent with high quality?

Most of the points raised above are about resource levels, not outcomes, so any discussion they prompt is likely to be about means, not ends. We should focus on ends.


Confusion and Conflation

My position: I don’t like much of the British press, partly because it leans quite right-wing. Some right-wing people are corrupt. George Osborne is amusing when he’s taunting the current government, but otherwise fairly unpleasant

At issue: Owen Jones tweeted this out earlier:

Two things struck me here:

  1. We do have a relatively free press. People can write and publish what they like, without government interference. The Press Freedom Index agrees: the UK was 40th in the world in 2018, in the “satisfactory” category. It would be better if we were positioned higher, and we should be trying to change our libel laws, among other things.
    What Owen presumably means is that we don’t have as much left-wing press as we do right-wing. That’s true by many measures, but it’s not the same at all.
  2. The comparison and extension (“We don’t have a free press… right-wing oligarchs… But this is utter blatant corruption.”) seems intended to link being right-wing with being corrupt. Lots of right-wing people are corrupt, perhaps oligarchs more frequently than others. But this seems like an attempt to tarnish all right-wing people, based on the extreme actions of one.

He’s right about George Osborne though. Wow, this is cynical. Owen could have stuck it to him without the unfounded complaints or smears.

Predictors for The Boat Race

It’s The Boat Race on Sunday, the historic annual competition between the best VIII of both Cambridge and Oxford, for no prize whatsoever. I took a look at the results on the Wikipedia page to see if there are any good predictors for the result.

TL;DR : the result of the second boat race is normally the same as the result of the first boat race, but isn’t significant. If a university has won the last three races, they’re likely to win again, and that is significant.

Read more

A Microeconomic Defence of Trade Unions

I recently had a discussion on Facebook about the value of trade unions. Two people in the discussion could not see that they had any value to the economy, one going so far as to suggest that they even made their members poorer. This post is a theoretical defence of the value of trade unions to a country’s whole economy.

Read more

Gaming Coursera Quizzes

I have signed on for a number of Coursera courses now, and each of them have assigned a heavy weighting to graded quizzes. Unfortunately these quizzes are typically easy to game: it is typically possible to score 100% without knowing anything about the subject. This post shows how that can be done, and suggests a solution.

Read more

Choice of Population and Mutation Frequencies

I read this article from Richard Dawkins as it seemed to be making a point about politics, language, and the way we think that I find really interesting. (I’ve had a post on language in science in draft for months!) However, what was most interesting was the insight I finally got into mutations in the population.

Read more