Friday, 6 March 2015

Passwords, Please.

A Canadian's on trial for failing to give Canada Customs his passwords on crossing the border.
A Quebec man charged with obstructing border officials by refusing to give up his smartphone password says he will fight the charge. 
The case has raised a new legal question in Canada, a law professor says.
Alain Philippon, 38, of Ste-Anne-des-Plaines, Que., refused to divulge his cellphone password to Canada Border Services Agency during a customs search Monday night at Halifax Stanfield International Airport.
Philippon had arrived in Halifax on a flight from Puerto Plata in the Dominican Republic. He's been charged under section 153.1 (b) of the Customs Act for hindering or preventing border officers from performing their role under the act.
According to the CBSA, the minimum fine for the offence is $1,000, with a maximum fine of $25,000 and the possibility of a year in jail.
See also Slashdot.

There should be a high hurdle for having to turn over personal details like cell phone contents to the state. If a judge is convinced of the need for it, on having seen sufficient evidence, that's one thing. But just on the request of somebody in a customs uniform?

Fortunately, this stuff so far is confined to the asylum: Oz, the US, Canada and the UK.

Unfortunately, Customs NZ wants us to enter the asylum too.
Customs is seeking new powers including requiring a person to provide a password or access to their electronic devices.
The agency has also floated other possibilities including collection of biometric information and making passengers empty their pockets if asked by an officer, even if there is no reasonable suspicion.
A discussion paper on changes to the Customs and Excise Act has been released, outlining a number of changes the agency wants considered. Currently, when Customs examines a person's electronic device the owner is not legally obliged to provide a password or encryption key.
It is relatively uncommon for people to refuse to provide this, Customs notes in the discussion paper, but "the number who refuse may increase as technology continues to develop". If people do refuse, Customs notes it "can mean we have no way of uncovering evidence of criminal offending even when we know the device holds this evidence".
If there's no way for Customs to get a warrant currently, then that should likely be looked at - although the hurdle here should be high too and Customs should be spanked if they too frequently make warrant requests that are turned down.

People in the Customs line are easily subject to intimidation, and a "Well, you can either unlock your phone, or you can wait here for hours and hours until we get a warrant" is coercive.

Is the whole world going mad?

From the Slashdot thread:
A friend, who is a lawyer, had confidential, lawyer-client privileged information on her laptop relating to a multi-million dollar business deal.Border guards demanded that she give them her password... They told her it was either not enter the country (and forfeit the deal) or give up her password. Her issue was that she was exposing privileged information to third parties who could, potentially, have illegally profited from the knowledge contained in that laptop.
At present, borders are dangerous legal limbo. This area needs deep oversight and clear paths for travellers to have recourse to constitutional rights.
The potential for state-sponsored corporate espionage through this mechanism should not be dismissed.

HT: Robert

Thursday, 5 March 2015

Teacher-run schools

A couple of weeks ago, Rose Patterson wondered why the teacher unions don't start their own charter school as demonstration project: to show what can be done when they call the shots:
Recently, the Washington Post wrote an article titled “to improve schools, let teachers run them”, about 70 U.S. schools that are completely teacher run, where kids are engaged and achieving.

Here is the rub. They are charter schools.

Teacher unions see charter schools as a threat to their existence, but they could also provide some opportunities to improve the status of teachers in the public eye. Imagine, for example, a professional arm of the PPTA setting up a fund to sponsor a group of teachers to start New Zealand’s first teacher-led charter school.
Not all the teacher-led charters have been successes though:
A decade later, the union is closing the school. Capital New York has the details:
 [T]he U.F.T. charter has consistently been one of the lowest performing schools—charter or otherwise—in the city and has received stern warnings from its authorizer, the SUNY Charter School Institute, about its viability.
Last year, SUNY issued a report on the U.F.T. Charter School in which it documented instability in leadership, low test scores particularly in middle school grades, lack of resources and disciplinary issues. 
The school has been an embarrassment for the union from the get-go, starting with an unfortunate 2005 incident in which its principal ordered two boys to clean up another student's feces off the bathroom floor, which, of course, made the tabloids. Since then the school has been plagued by principal turnover, textbook and material shortages, and fiscal problems. There have been 10 reported incidents of corporal punishment.
This hardly damns the model, so long as the system can expeditiously identify failures and either fix or close them. But it does not speak well of the operator.

Wednesday, 4 March 2015

Batting out your overs

The mantra that "the biggest sin a team batting first in an ODI can commit is to not bat our its overs" has long been a bugbear of mine. As Dan Liebke noted in a rant about net-run-rate the other day, 
We've had Duckworth Lewis for decades now and, even if the mathematics of it is beyond most casual fans, the basic concept that wickets remaining are a resource that need to be considered along with overs remaining is pretty well established. 
Yes, a team has two resources. If it is a sin to not use one of those two resources to the max, why is not also a sin to bat out 50 overs leaving capable batsmen in the pavilion with their pads on? A batting team has to manage both declining resources with no certainty as to the effect that its actions will have on either the rate of scoring or the loss of wickets. 

So I was very happy to see Chris Smith take on this mantra in his Declaration Game blog, and also to see him quote a former player, Geoff Lawson, who was prepared to take a contrarian view. 
`Why?' asked Geoff Lawson, who went on to rationalise that if all the batting side attempted was to survie the 50 overs, they were very unlikely to set a winning total. `Wouldn't it be better', Lawson argued, `to hit out wiht the aim setting a challenging targe, accepting the risk that they could be bowled out, than to crawl to an unsatisfactory total?'
Lawson is right, although maybe not quite. In this quote, he seems to be suggesting that a team that is heading towards a very low score might as well start taking more risks to get to a competitive total. This is a manifestation of a mathematical theorem known as Jensen's inequality, when optimising over a relationship that is not linear, but actually, the relationship between the total score and the probability of winning is pretty much linear over the range of possibilities that can occur on any particular ball. That means, that a batting team should always ignore the current score, accept bygones as bygones, and base their level of aggression on how many balls and wickets they have remaining.

As it happens, we can quantify this decision reasonably precisely. The graph below gives a measure of what I like to call "deathness" for the first innings. The particular metric I use is the payoff to a risky single. Imagine that the batsmen have to choose between trying for a run or not. If they choose not to run, they will score 0 runs but not lose a wicket. If they try for the run, there is some probability that attempt will fail and one batsman will be run out, or they might succeed. What probability of being run out would be too high to make the risk not worth the cost. The graph shows that cross-over probability as a function of the number of overs bowled, for each possible number of wickets lost. The higher is the probability, the greater is the risk that it is worth taking and so the greater is the level of deathness (so called, because the final overs in an innings where batsmen start to take higher levels of risk is often termed "the death"). The actual numbers aren't particularly interesting (most decisions on aggression are about striking the ball, not about whether to attempt a run), but the comparison across different lines in the graph is revealing. So, for example, the graph reveals that if a particular level of aggression is warranted after 40 overs when a team is 5 wickets down, then the same level can be justified at 23 overs if no wickets have been lost.  

Before getting to batting out your overs, a few things to note about this graph:
  1. It is based on WASP data that predates the rule change to two new balls and only four outside the circle. That said, the basic story would not change using more recent data or some other estimate of the cost of a wicket such as the Duckworth-Lewis tables. 
  2. This table indicates what the expected payoffs are to different levels of risk and return in different game situations; it does not show what different risk-return combinations are possible. So, for 0-7 wickets down, the graphs indicate that the cost of risk is high at the start of the innings (the probability of a run-out has to be very low to justify attempting a run). With the fielding restrictions in the first 10 overs, however, it can be that the return to batsmen from a particular level of risk is much higher than in the middle overs, so that a high-risk strategy is still worthwhile, despite the costs. 
  3. The graphs all hit 100% for the final ball of the innings. That makes sense. It is simply saying that as long as there is any probability whatsoever of not being run out, you might as well keep running until you lose your wicket on the final ball.  
  4. Interestingly, though, for 1, 3 and 6 wickets lost, the graphs hit 100% before getting to the final ball of the innings. Remember that this is based on average-team versus average-team data. What is going on here is that on average the batters deeper in the batting order, are better at power slugging than those further up the order. So, for example, it is common for a batting order to have two aggressive openers followed by an accumulating #3 to take the team through the middle overs. If a team gets to 43 overs with only one wicket down, it might be better to go for a suicidal run (with the #3 coming to the danger end) and bring in a power hitter than to play out a dot ball. 
  5. The graph for 9 wickets down slopes down for most of the graph. This is mostly reflects out-of-sample extrapolation (there is no actual data for games where a team is 9 wickets down after 2 overs), and also the fact that when a team is 9 wickets down very early, there is almost no chance they will bat out their overs, and are likely to lose their last wicket any time so its worthwhile the batters taking risky singles while they are still there to do so. The longer the innings progresses, the less reason there is to think that the next wicket is imminent and so more need for caution. 
  6. While there is a general tendency for the graph to be lower the more wickets that have been lost, this tendency is not absolute. This is because, while losing a wicket will reduce the expected number of runs the team will score, the cost of the next wicket is not necessarily greater. For example, after about 46 overs, the incremental cost to a team of losing its 7th wicket is less than losing its 5th or 6th at that stage, so a team being 6 wickets down should be more aggressive than one that has lost only 4 or 5 wickets. 
So let's now think about batting out your overs. In the World Cup game between New Zealand and England, England batting first lost their 6th wicket at 28.1 overs, their 7th later in the same over, and their 8th at 30.4 overs. Looking at the purple, yellow and pink lines, the deathness measures at 28-30 overs, are all pretty much the same. Yes, a lot more caution was called for than if they had only been 2 wickets down at that point (and so Broad's approach at that point was probably not beyond reproach), but also the optimal strategy was not for the team to go into its shell. Rather the situation called for playing in much the same style as any team should do in the middle overs (10-30) but delaying all-out aggression for a bit longer than if they had more wickets in hand. This pretty much describes any situation where the "make sure you bat out your overs" comment is likely to arise. A team should probably delay its all-out assault for a bit if it loses too many wickets, but at no point should it bat more conservatively than in a normal middle-orders situation.  

Risky ideas

If you wouldn't take an unapproved drug, would you really risk hearing unapproved ideas?

Maybe it sounds nuts, but it's something New Zealand's Chief Censor worries about:
Chief censor Andrew Jack argues censorship has never been more important, precisely because entertainment now comes in so many forms via so many different devices.

And there's a growing recognition that, to some extent, you are what you watch.

"If I'm watching pornography that's R18, there's nothing wrong with that. Except that if I watch large quantities of it it may be influencing the way I interact with real-life women. I think people perhaps are beginning to become more aware that you are the totality of your experience."

Take the classification officers themselves. They're a resilient bunch who stick around for an average of 10 years but every now and then one sets out to change the world and gives up in disillusionment after six months of drowning in the depths of depravity.

"This kind of proves the point that what you watch does influence your world view, " Jack says.

Like the child abuse images, there is simply more of everything out there. And the more there is, the more important it becomes that people are given good information so they can make smart choices about what they watch, he says.

"If you access stuff that hasn't been classified in New Zealand you are taking a risk around you and your communities and your families. You ought to be just as careful about that as if someone came up to you at a party and said 'Here, take this pill'. You'd want to know what was in it. You are not just going to say 'Oh, great, well I'll take it'." [emphasis added]
The whole article is well worth reading: very meaty stuff for the Dom Post's entertainment section. The article notes that the Censor's office spends about 22% of its time on stuff like classifying images of child abuse sent them by the Police. The rest of the work really seems surplus to requirements.

Our kids' entertainment is almost exclusively stuff that has never passed by the New Zealand censor. We watch DVDs that we imported from America without his approval: the kids love Animaniacs, Freakazoid and Princess Bride. We watch movies and TV shows on Netflix like Adventure Time, PowerPuff Girls, and Mr. Peabody & Sherman. All this stuff has likely also been rated by the New Zealand Censor,* but we neither know nor care.

When new shows come up and we want to know whether or not they'd work for our kids, we don't go looking for a New Zealand Censor's rating. Instead we start with IMDB and other online recommendations. They'll tell us more, and more quickly, about what works for our family than the Censor ever could.

Example? Princess Bride, above. I hadn't checked the Censor's rating on it before. Checking it now took 5 clicks from the homepage, plus a search input, then an additional click to find that the Censor rated it PG in 1987 with no additional detail. If I wanted to email the details to my wife, I couldn't send her the link: their database back end puts up URLs that can't be shared. I'd have to cut and paste the page. The best URL I could share would be the one going to the search database, where you'd still need to input the text and hope that not too many titles come up.

Alternatively, I can just type IMDB Princess Bride into my browser's title bar, click the first link, then click the "Parents Guide" link on the IMDB page that comes up to find very detailed listings of anything any parent wanted to note about the film. And here's the link to it.

The Censor's rating programmes for distribution in New Zealand is entirely surplus to requirements for anybody with a web browser.

Right now, none of it really matters for us as it's pretty unlikely that we'd be picking stuff that the Censor might have deemed illegal to watch with someone who's under the age of 13. But we might start hitting that line when the kids are 11 or 12. When it does, we'll just keep doing what we do now: using our own discretion.

* The Censor's Office, in the past few years, stopped rating things that had already received a non-restricted rating in Oz, which would likely catch some of those. But other ones would have had to have had some NZ rating because they would have been released here prior to that law change.

Tuesday, 3 March 2015


Radio New Zealand featured Alan Gibbs on Sunday. It's worth a listen.

I love the story of Ralph Hotere installing an artwork at Gibbs's farm. Hotere was lauding communist Cuba, so Gibbs brought him to Cuba to show him what it was like. Travel to Yugoslavia and East Berlin had convinced a younger Gibbs that socialism didn't work; Hotere was a bit more immune to updating based on evidence.

His discussions of the import licensing regime under which NZ operated is also worth hearing - especially for the kids who hear all the critique of the reforms of the 80s but who are clueless about why they were needed. That's from around the 25 minute mark.

At the 35 minute mark, he describes how in the 1970s his trucking company had to get licences for each truck, with opportunities for his competitors to object. Fortunately there's nothing like that now.

When entrepreneurial energy goes into figuring out how to get import licences and local regulatory monopolies....

HT: Jenesa Jeram

Monday, 2 March 2015

Feeling Chuffed Again

I'm looking forward to doing my first lecture at Victoria University today, so I hope it is not disloyal to write a post celebrating the success of students from the University of Canterbury.

Last year, I wrote celebrating post-graduate successes of students from my Honours class of 2009, and lauding the diversity of the Canterbury programme that emphasised both analytical rigour and traditional liberal arts learning. This year, the cause for celebration is the recent graduate recruitment round by the Reserve Bank of New Zealand. Three students who were in my intermediate-micro-with-calculus sequence in 2013, Amy Rice, Michael Callaghan, and Simon Greenwood, were successful in securing positions at the RBNZ for 2016 in the early-bird recruitment round for the RBNZ. My understanding is that they were the only three students in New Zealand to receive such offers. Two of them, Amy and Michael, also received Reserve Bank scholarships for their Honours year in 2015.

These successes continues the astonishing record Canterbury has had in placing students into the RBNZ over the past decade. Sadly, this might be one of the last cohorts from Canterbury to enjoy this success. As a result of the financial difficulties following the earthquake, management there has decided that the Department needs to focus on its broad-based B.Com. Accordingly, it no longer offers micro with calculus at the second year, has cancelled its Arts-style current-economic issues course, and has introduced a new Bachelor of Business Economics major targeted at a different group of students. In the current financial environment with a much smaller department, it was probably necessary for Canterbury to narrow its focus, but I hope they are able to return to offering its top students a strong maths-based, liberal-arts-consistent programme. The country needs rigorously trained economists with multi-disciplinary grounding. Fortunately, Otago, Vic and Auckland still offer calculus-based micro at the second year.

Impoverished journalists

Did you hear the story of the indebted journalist who, when on assignment hanging out as a beggar for a while to be able to write on life from the streets, found he made more money begging than he did as a journalist? So he quit his journalism job and became a professional beggar, earning enough to pay off the debts.

Times are tough for journalists when they can make more begging on the streets.

If you hadn't read the story, it's here. Arthur Conan Doyle, The Man with the Twisted Lip. 1919.

As I've already spoiled the conclusion for you, here's the excerpt.
"You are the first who have ever heard my story. My father was a school-master in Chesterfield, where I received an excellent education. I travelled in my youth, took to the stage, and finally became a reporter on an evening paper in London. One day my editor wished to have a series of articles upon begging in the metropolis, and I volunteered to supply them. There was the point from which all my adventures started. It was only by trying begging as an amateur that I could get the facts upon which to base my articles. When an actor I had, of course, learned all the secrets of making up, and had been famous in the greenroom for my skill. I took advantage now of my attainments. I painted my face, and to make myself as pitiable as possible I made a good scar and fixed one side of my lip in a twist by the aid of a small slip of flesh-colored plaster. Then with a red head of hair, and an appropriate dress, I took my station in the business part of the city, ostensibly as a match-seller but really as a beggar. For seven hours I plied my trade, and when I returned home in the evening I found to my surprise that I had received no less than 26s. 4d.
 "I wrote my articles and thought little more of the matter until, some time later, I backed a bill for a friend and had a writ served upon me for 25 pounds. I was at my wit's end where to get the money, but a sudden idea came to me. I begged a fortnight's grace from the creditor, asked for a holiday from my employers, and spent the time in begging in the City under my disguise. In ten days I had the money and had paid the debt.
     "Well, you can imagine how hard it was to settle down to arduous work at 2 pounds a week when I knew that I could earn as much in a day by smearing my face with a little paint, laying my cap on the ground, and sitting still. It was a long fight between my pride and the money, but the dollars won at last, and I threw up reporting and sat day after day in the corner which I had first chosen, inspiring pity by my ghastly face and filling my pockets with coppers. Only one man knew my secret. He was the keeper of a low den in which I used to lodge in Swandam Lane, where I could every morning emerge as a squalid beggar and in the evenings transform myself into a well-dressed man about town. This fellow, a Lascar, was well paid by me for his rooms, so that I knew that my secret was safe in his possession.
     "Well, very soon I found that I was saving considerable sums of money. I do not mean that any beggar in the streets of London could earn 700 pounds a year -- which is less than my average takings -- but I had exceptional advantages in my power of making up, and also in a facility of repartee, which improved by practice and made me quite a recognized character in the City. All day a stream of pennies, varied by silver, poured in upon me, and it was a very bad day in which I failed to take 2 pounds.
     "As I grew richer I grew more ambitious, took a house in the country, and eventually married, without anyone having a suspicion as to my real occupation. My dear wife knew that I had business in the City. She little knew what.
Shades too of Gordon Tullock on Competing for Aid.