Given all the debate about airport expansion, it's extraordinary that the fact the second Gatwick runway already exists isn't more widely known.

This second runway was created for emergency use by upgrading the existing taxiway in 1979. However, the two runways can't be used simultaneously because they are too close to each other by a mere ten metres.

When Gatwick says it wants a second runway, it is merely asking to shift its northern runway 12 metres further north.

If this happened it wouldn't double capacity but would push the airport up to 75 million passengers a year. (Heathrows busiest ever year was circa 80m)

There is a planning inspectorate examination that runs until August. Then up to 3 months to submit a report to SoS. Then up to 3 months for SoS to decide. Presumably, the election is going to delay some or multiple parts of this.

Gatwick offers the best experience for most travellers. Relatively nice terminal. Compact compared to Heathrow, and the station is literally in the terminal building with direct trains to Victoria, London Bridge, and Brighton all taking 30 mins. The main advantage Heathrow has is its scale with a greater range of flights.

We should expand both

It's increasingly crazy that you can't cross this stretch of river on foot. The Rotherhithe tunnel has a pavement in it but comes with health warnings. And it still drops you out nowhere near Canary Wharf.

We need a pedestrian/cycle bridge to Canary Wharf from Rotherhithe or Surrey Quays. It feels like the sort of thing you could fund with a couple of S106 agreements. I wonder if you even need the S106. A developer could surely take the initiative on their own if enough planning permission was granted

Surely this is not the equilibrium:

The publicly funded bridge scheme is very expensive and once again on hold

I assume some of the expense is because it has to let at least as much stuff as Tower Bridge (which can lift) is able to

I wonder if it would be cheaper to have it start and end further from the river so it could rise higher? Or even just bore a tunnel?

An interesting idea I've heard is to get Swiss cable car engineers to come and build cost-effective cable cars along the river. They build them magnitudes cheaper than us and theyre often fully integrated into network timetables and fares.

Holding back the floods for 40 years: Thames Barrier is due an upgrade

*The barrier was designed to protect Londoners from rising sea levels and the north-south tilt, which is gradually sinking the south-east of the country.*

TIL about the north-south tilt

England is sinking while Scotland rises above sea levels, according to new study

*The new study shows that land levels could rise by up to 10cm in some areas of Scotland over the next century, offsetting the effects of sea level rise caused by global warming. But in parts of England, where the land is set to sink by up to 5cm over the next century, it could add between 10 to 33 per cent on sea level rises.*

Levelling up eh

Expanded mobile phone coverage goes live on Elizabeth line and Underground

Apparently, Paris have just integrated their metro ticketing system with Apple Wallet I was there this month and used it about 15 times last week. Didn't realise it was brand new. Certainly a massively easier experience since the last time I was there.

SF had a similar plan to London's Ringways plan

*After a sweeping attempt to undermine such local regulations failed last year, lawmakers are tackling them this session in separate bills. One bill nearing the finish line would force some cities to allow more dense housing near transit lines; another would overrule some local governments and legalize accessory dwelling units. Others would fund new transit projects and services.*

Quite interesting to see people who have made their way to the very top more of less through a single institution:

- An Interview with Walmart CEO Doug McMillon About Omnichannel Retail (LinkedIn)
- Pano Christou - President/CEO of Pret A Manger (LinkedIn)
- Damon Hininger - President/CEO at CoreCivic (LinkedIn)
- Lewis Ranieri of Salomon Brothers (Wikipedia)

Stripe launched the ability to pay by bank . In theory, everything using this gets a few percentage points cheaper.

And a great Patrick McKenzie post about the innovation that lead up to this

It'd be interesting to read a theory by which some careers become

- Well-paid with a good work-life balance e.g. tech
- Well-paid with a bad work-life balance e.g. banking/law
- Badly paid with a good work-life balance e.g. most things
- Badly paid with a bad work-life balance e.g. medicine (though badly paid for medicine is a bit of a UK thing. Amazingly paid in USA. WLB Decent for nurses/PA too)

Byrne Hobart has an explanation for the second of these groups

In related news Freshfields NQ pay rockets past A&O Shearmans to 150,000

According to Wikipedia, in 2019, Freshfields became the first non-US law firm to raise the salaries of newly qualified junior lawyers in the United Kingdom to 100,000, then 125,000 in 2022.

No wage stagnation in lawyers' salaries!

Brewdog boss James Watt steps down from CEO role

How should we judge Renaissance's performance? On the one hand...

On the other hand...

and...

A little discussion on how they do it, and how little we can know, and how little knowing would even help us if we did know, etc...

God and Renaissance Technologies' Black Box

Inside a Moneymaking Machine Like No Other

*In 1993, Renaissance stopped accepting new money from outsiders. Fees were also ratcheted upfrom 5 percent of assets and 20 percent of profits to 5 percent and 44 percent. They raised their fees to exorbitant levels and were still head and shoulders above everyone else, says Bonnefoy, who, along with every other outsider, was finally booted from Medallion in 2005.*

Byrne's model of Renaissance is very illuminating. In particular, the stuff about employee retention:

Nobody compounded their money at 66% annualized for thirty years. Not Jim Simons, not James Ax, not Leonard Baum, not Elwyn Berlekamp. Everyone gets cashed out to some degree, because it's economically implausible for their money to keep compounding that fast forever. And when a given strategy can produce high returns on capital based on the specialized knowledge of the people creating and implementing that strategy, the specialists will have all the leverage in deciding how returns will be allocated... The most sustainable structure for such an investment vehicle is for all of the returns to go to the people who are producing them, except for a slice that goes to people who could produce a subset of them but could be paid not to.

A great piece reflecting on how start-ups are a more accepted career route in the US than the UK. Ends up saying that we just have to wait for the numbers of former founders and execs with money and skills to grow.

Monzo Nabs a $5.2 Billion Valuation After Raising More Money - Bloomberg

Amongst my friends, Monzo is the overwhelming winner. But on the continent, Revolut is everywhere.

Meanwhile, Latin America's NuBank is even bigger still

Notion Calendar, formerly known as Cron, is the best calendar product I've found. I've tried Google and Apple and neither are as good. Sync NC with Google and away you go.

For any keyboard-only power users and/or RSI sufferers,Homerow looks very cool

I always assumed things were going great down under but apparently not...

Australias never-ending per capita recession

Immigration and the housing crisis

*You only have to look at Australias performance over the past 20 years of this big Australia experiment. Australias per capita GDP has fallen significantly, our productivity growth has collapsed, we have experienced capital shallowing, (because) if you grow your population faster than you can grow infrastructure, business investment and housing, youre going to have less capital per worker, he says.*

Initially, it does look like Australian growth has stagnated

But apparently this is mostly just exchange rates. In PPP with constant currency Australia has grown by 15% since 2008, Vs 10% for the UK and 17% for the US.

*Taipei has only built 25,000 units in the last five years.*

There's quite a lot in here about how Taiwan's land tax system is broken.

Apparently, rental yields are less than 2% in Taipei. The piece doesn't explain that but probably should.

This Tooze piece has some interesting quotes about the depth of US wealth in placesyouvenever heard of

Auto dealers are one of the five most common professions among the top 0.1 percent of American earners. Car dealers, gas station owners, and building contractors, it turns out, make up the majority of the countrys 140,000 Americans who earn more than $1.58 million per year. Crunching numbers from the U.S. Census Bureau, data scientist and author Seth Stephens-Davidowitz found that over 20 percent of car dealerships in the U.S. have an owner banking more than $1.5 million per year. And car dealers are not only one of the richest demographics in the United States. Theyre also one of the most organized political factionsa conservative imperium giving millions of dollars to politicians at local, state, and national levels.

These elites wealth derives not from their salarythis is what separates them from even extremely prosperous members of the professional-managerial class, such as doctors and lawyers - but from their ownership of assets. Those assets vary depending on where in the country were talking about; they could be a bunch of McDonalds franchises in Jackson, Mississippi; a beef-processing plant in Lubbock, Texas; a construction company in Billings, Montana; commercial properties in Portland, Maine; or a car dealership in western North Carolina. Even the less prosperous parts of the United States generate enough surplus to produce a class of wealthy people. Depending on the political culture and institutions of a locality or region, this elite class might wield more or less political power. In some places, it has an effective stranglehold over what gets done; in others, its important but not all-powerful. . An enormous number of organizations and institutions are dedicated to advancing the interests of this gentry class: chambers of commerce, exclusive country clubs and housing developments, the American Society of Concrete Contractors, and fruit growers associations, just to name a small cross-section. Through these organizations and their intimate ties to local and state politics, the gentry class can and usually does wield significant power to shape society to its liking. Its easy to focus on the massive political spending of Sheldon Adelson or Michael Bloomberg; its harder, but no less important, to imagine what kind of deals about water rights or local zoning ordinances are being struck across the U.S. on the eighth green of the local country club.

It links to this piece which had some interesting history of car dealerships but might need some salt

NYC's Education Budget by the Numbers

*If you took a grand accounting of all the money that NYC spends per pupil, it would be much higher than discussed in this post ($34,667 as of FY2022, according to the IBO)*

*Fully one-third of NYCs annual operating (expense) budget goes to the DOE. This is about $37.5 billion dollars, compared to the NYPDs $11 billion.*

That seems insanely high. Britain's equivalent number is 7,460 according to this. I wonder if London is much higher than the British average?

Cool dataviz. Confirms everyone's preconceptions.

Wayve raised a billion dollars

Some discussion in [this episode of the Autonocast](https://podcasts.apple.com/gb/podcast/autonocast/id1168333433?i=1000655083284. The case seems to be that they are the best candidate to compete with Mobileye selling assisted driving tech to OEMs.

And the government have passed the Automated Vehicles Act. Wayve and Oxa seem happy with this. I don't get where the 2026 date comes from though. Is the idea that companies can start the process of getting approval now and that the process takes 18 months? What actually are the concrete metrics/tests that a company as to pass?

American AI group CoreWeave to invest 1bn in Britain

Scale AI chooses Britain for first international headquarters

*Always interesting to be reminded that of the 124.6bn of GVA created by the UK's creative industries in 2022, 53.4bn (42.8%) came from the IT, software and computer services subsector. (To be clear, this doesnt mean statisticians identified 53.4bn of creative output produced by the IT sector and included it in creative industries; rather, the whole IT services sector is classified as part of the creative industries.)* Link

The Evolving Landscape of LLM Evaluation

Platforms and Publishers: AI Partnership Tracker

How to make more money renting a GPU than Nvidia makes selling it

The next iOS will have eye tracking

I've wanted a Remarkable or some other e-ink tablet for years but never actually needed one. The new Daylight tablet looks gorgeous. But, as a quote tweet points out, this has the same sense of freshness and excitement as Roam Research in 2020...

Emulating humans with NSFW chatbots

Its interesting how different the business model is from other generative AI companies because NSFW monetises so much. Still a bit baffled by the appeal.

Several years after this piece we finally have some updates on desalination progress:

Vauxhall owner to sell cheap Chinese EVs in UK and mainland Europe

*Stellantis, which owns brands including Fiat, Peugeot and Vauxhall, will start selling two Leapmotor models in September, at prices of less than 20,000 (17,200). UK sales will start in March 2025.*

Chinas BYD closes in on deal to build all-electric London buses

*The Go-Ahead Group is set to award the company a contract to build more than 100 all-electric double-deckers at a price of about 400,000 each 100,000 cheaper than UK competitors, sources said. It is the first time that BYD has won a contract to provide EV double-deckers in the UK, pipping local competitors such as Alexander Dennis.*

*Sir Iain Duncan Smith, MP for Chingford in London and a former Conservative Party leader, lamented the decision to award the bus contract to BYD. Weve yet again gone to China to build buses. What is the matter with our domestic production? These are iconic, British London buses. Why is it that we simply do not look for a contractor based, if not in the UK, then certainly in Europe, he said*

I think the answer is right there Sir Iain. We could probably close some of the gap by permitting more energy infrastructure. Remember we have the most expensive commercial energy in the world.

New Kia EV3 is a 30k electric car with a 372-mile range

If the 30k version actually does that range this looks like a new price-to-range milestone

Tesla makes push to roll out advanced FSD self-driving in China

New BYD Hybrid Can Drive Non-Stop for More Than 2,000 Kilometers

AstraZenecas Tagrisso greatly slows cancer for some people with stage 3 lung cancer

World-first tooth-regrowing drug will be given to humans in September

British-built unhackable navigational system flown in world first

I'm trying to improve my shoulder mobility. Some useful videos I've seen:

Keen for any other tips/routines

My friend Theo is selling these Tweed Nehru gilets which I think look great

Fashion stopped changing for about a decade after the financial crash. But there seems to be a shift happening now. We're getting baggier and more high-wasted e.g.

- https://x.com/bestofmescal/status/1796091525253771376
- https://www.atemporubato.com/
- https://www.instagram.com/reel/C7bjTdXoXDB/?igsh=amQyZXF3ZTc1OXVi

How do I handle a friendship breakup?

*When my parents got married, they decided that there were certain things that were difficult to say and should therefore be replaced by numbers. Only one survived in actual usage. In their family number two meant, in my family still means, You were right and I was wrong. One reason is that it is shorter, so easier to say. A second reason is that using the number reminds speaker and audience that admitting error is a difficult and virtuous thing to do, which makes it easier to do it. A third reason is that using a family code reminds the speaker that he is speaking to people who love him, so are unlikely to take advantage of the confession of error to put him down.*

https://x.com/anaisisreading/status/1794917950874669299

Are running clubs the new dating apps?

The Last Freeminers of England

Nice account by a girl who is perpetually repairing her Land Rover. There's a part of me that wishes I knew more about engines but mostly I hope that the EV transition is just going to abstract this stuff away

Plans approved for 61.8m redevelopment of Lord's. I don't get the stuff in here about Middlesex considering moving. Presumably, they're negotiating rent and want to generate some leverage.

Great thread on the economics of Clarkson's Farm

There are new Eleven Labs and Suno music generation models out this month. They can now do proper 4-minute songs. I spent a day generating songs full of in-jokes and spamming group chats but haven't gone back. A big unlock for me would be if they can start generating background music indefinitely that has a particular vibe. e.g. Something that sounds like the Halt and Catch Fire soundtrack while I code, or the Kln Concert.

Pretty low expectations for this, obviously. It's worth mentioning though that there is quite a charming amateur film on Youtube on this subject. If you like it you might also like this one about Arathorn. Just 19 more years until Tolkien's works enter the public domain. Hopefully, we'll then see more stuff from people who "get it".

Nice 5-minute video about San Francisco's Victorians and how the styles vary by decade

Some rather nice infill new-builds in Deptford

Idhadn't seen a video of the Jetson, the vehicle that was the profiled in the New Yorker flying car story last month until now

*How a viral post got some key statistics wrong*

Probably not a good one to cite when making the case for traditional architecture cheaper than modern architecturehttps://www.smh.com.au/cbd/castle-s-still-in-the-air-for-scots-college-20230913-p5e4gk.html

Although actually.80 million Australian dollars is 42 million pounds which is the same amount that Lambeth Palace spent on their incredibly cheap-looking libraryhttps://anglicanmainstream.org/stratospheric-costs-of-ugly-new-lambeth-palace-library-need-explanation/

New Zealands sheep-to-people ratio fell again in 2023

Meanwhile, the lamb price in Britain is really high. We've been getting 190 a lamb this year. Some discussion of why here

Computer Scientists Invent an Efficient New Way to Count

This is delightfully simple yet clever

DNA confirms there IS a big cat roaming the British countryside

*The DNA of a big cat in the Panthera genus probably a leopard has been identified from a swab taken from a dead sheep in the Lake District. This is the first time that big cat DNA has been found on a carcass in the UK. The analysis was carried out at a laboratory at the University of Warwick run by Prof Robin Allaby.*

Cool piece on picture framing with examples of how it can improve a painting

1898: The Birth of New York City

Did you know Staten Island nearly seceded in the 90s and there are still rumblings

(In 1989), the state Legislature passed a measure signed by then Gov. Mario Cuomo authorizing a study and initiating the process for Staten Island to secede from New York City on the last day of its legislative session.

By 1990, Staten Islanders voted overwhelmingly in favor 83 percent of a secession study and by 1991, Cuomo swore in a New York State Charter Commission for Staten Island.

Two years later, in 1993, Staten Islanders approved 65 percent a non-binding referendum to secede from New York City and the state Senate also approved a secession bill.

But those efforts came to a halt when former Assembly Speaker Sheldon Silver refused to allow a similar measure to be voted on in the Assembly without a home rule message from New York City.

The city never held a secession vote and the measure for Staten Island to secede died in committee

Singapores shophouses hotter than Fifth Avenue?

The Windows 10 desktop background is a real photo

It's worth spending some time looking for the same product on other websites

Obviously a moot point in the real world where we're not joining, but worth pointing out.

To actually calculate something like this you would need to disentangle income from income (which would be pushed up) from output - which would be pushed up only insofar as the higher income was spent on location-based activity, and then you would need to estimate population flows, etc

]]>If anyone has anything they think I should add or can answer any of these questions, let me know on Twitter!

It's a fairly modern university. Founded in 1957 though it can trace some roots back a few decades earlier. It's less weighed down by history. Harder to "confuse learning with the smell of cold stone".

One of the businessmen who founded it, Gerry Hagey, based the co-op system on systems he'd seen work effectively in the US.

It was founded with an emphasis on mathematics, and practical mathematics at that. The first head of the maths department, Ralph Stanton, *"had written a textbook on numerical analysis, a branch of mathematics that is closely aligned with computing. In 1960, the university established its Computing Centre, and suddenly math had a practical application. The department grew so quickly it was expanded in 1967 into a separate faculty, the first in North America".* - Source

Because the faculty became so big so quickly, they seem to have received lots of equipment donations from e.g. IBM and DEC.

Wes Graham was the first director of the Computer Science faculty and seems to have established a culture with a lot of autonomy for faculty and researchers. He seems to have played an important role in seeding a tech ecosystem around Waterloo. He created the Waterloo Fortran Compiler (WATFOR) which was apparently a very useful tool for teaching students programming and was adopted by many places around the world.

Graham seems to have focused research and teaching on how to use computers effectively when most research was focused on building computers. You could imagine an innovative faculty adopting a similar attitude to AI today.

Under Doug Wright in the 1980s, the UW let individuals retain the IP from their research. This is often cited as something that makes Stanford particularly innovative.

I've seen a ~4% acceptance rate claimed online.

Anecdotally UW Computer Science is very selective but not more so than e.g. the University of Toronto which doesn't have the same reputation.

UW is apparently no more expensive than other Canadian universities, and Waterloo is a cheaper place to live than Toronto or Vancouver.

Some claims suggest only 60% to 80% of the matriculating class graduate.

How many UW Waterloo grads move to the US and therefore have easier access to higher wages?

- Perhaps 85% - https://x.com/danluu/status/1351785083598893062

Things to consider when estimating graduate salaries:

- Conversion between Canadian and US dollars.
- Are they including sign-on bonuses in total comp?
- Are they weighting options by how many have actually vested?
- Because tech salaries are so big in the US and in particular the Bay Area, the biggest predictor of graduate salaries is going to be the proportion of graduates who move. And because it's fairly easy to move from Canada to the US this proportion is likely to be quite high. So it's necessary to look at both Canadian and US salaries to see how UW students are doing relative to graduates from other North American universities.

Notable alumni:

- Jason Liu
- Clive Chan
- Jesse Rodgers
- Hongwei Liu
- Liam Horne
- Victor Mota
- Anson Yu
- "John from Risona(?)" (heard Jason mention this person on the Latent Space podcast but can't find who he was referring to)
- [Chamath Palihapitiya](https://twitter.com/chamath]
- Guillaume Verdon

*"Pre-Internet era, Microsoft hired more undergraduates from the University of Waterloo than any other school globally. Every new tech leader in every new tech era since then has secretly tapped this source of talent."* - Source

The degree (including co-ops) takes 5 years, including working during summer. That's significantly more time than a 3-year British degree or 4-year American degree.

There is something called the Canadian Engineering Accreditation Board. This body seems to set the standards that students studying engineering courses need to meet.

- Does having an external standards body prevent grade inflation and allow for comparisons and competition among Canadian universities?

Some people have suggested that the UW CS faculty's origins in the department for mathematics differ from other universities where CS department is closer to engineering. This may be because co-op students are easier to integrate into companies creating software instead of doing physical engineering.

Alumni report that there isn't much of a sports or party culture to distract people there.

Apparently, Wilfrid Laurier University, also in Waterloo, has more of a party culture.

*"Extremely common and normal for people to be working on projects/hacking on a Friday night, on their own volition or otherwise ... Also not unusual for people to be working part/full-time jobs on top of school."* - Source

*"Much of the quality of graduates is due mainly to selection/peer effects. There are more advanced courses at UofT/Waterloo than at the other Ontario universities, but for the most part, the undergrad curriculum is the same. What changes is the quality of work expected by professors and how much you learn from your peers. At lower-ranked universities, like TMU, professors are much more lenient, final exams are easier, and grades are curved. It's sort of like how students in many fields take an introductory statistics course, but depending on which field you're in (e.g. PolSci/Biomed/Statistics/Economics) your understanding of the material drastically differs"* - Source

*Waterloo co-ops are year-round, not just over the summer. Companies that rely on summer-only interns tend to frantically come up with made-up projects for them to do two weeks before they start. If you have a year-round supply of interns, you treat them as normal engineers who pick up actual product work.* - Source

Co-op lengths are 4 months plus with an expectation of doing at least 5 varying terms or 20 months over the course of a degree.

- Which companies take part?
- Do they choose their interns? If so, how?
- Are the anecdotes of great coop terms biased towards the best students who get the best internships?
- What is the experience like for the bottom half of each year group?

How do get companies the most out of their interns and how do interns get the most out of their companies?

*"I have first-hand experience from the flip-side of the Waterloo co-op program, that is, from the perspective of the employers who hire a significant number of co-op students. The reputation of the Waterloo co-op program is more than anecdotal, IMO. The co-op program eliminates the seasonality of "summer employment" by having three four-month terms every year with the students swapping between school and work terms. The entire community adapts to this cadence that ultimately influences everything from student housing to extracurriculars / socializing to the type of work employers expect from their co-ops. It takes time for a co-op program to reach critical mass both within the educational institute and the employer community, therefore, Waterloo's success can't be explained away. The University/community has a distinct advantage."*

*"The rule-of-thumb is that a co-op employee is about twice as productive as an experienced full-time employee doing the same work. The reason is transaction costs ;-) Full-time employees' days are filled with meetings and other administrivia that disrupt our core work. Co-op students, on the other hand, achieve a state of flow, on an almost daily basis, that would be a thing of beauty to behold if it wasn't so damn annoying ;-) Freedom takes many forms and it's hard not to be envious at times."*

*"The community of co-op employers are often co-op program alums and are a key ingredient in the success of the program. For the economic minded who are interested in incentives, Waterloo has perfected, IMO, aRank/Matchsystem where the top students AND employers quickly rise to the top. After the interview rounds, both students and employees receive sometimes harsh feedback on their perceived rank. Meritocracy is embedded in the program. Both mediocre students and employers are quickly weeded out. The true super-stars can pick any path that tickles their fancy but they can never coast. With great power comes great responsibility Spiderman :-)"*

*"Every term you get a new cohort that only has a handful of courses under their belts. Every co-op goes through extensive on-boarding, mentoring, and on-the-job training by talented employees who repeat the process every four months. The co-ops themselves form tight-knit groups that span all the experience cohorts within each company. They depend on each other as much as they depend on the full-time members of the multi-disciplinary teams they work with. I think multi-year cohorts are also one of the main reasons that junior/senior high school sports programs are often beneficial compared to their same-age divisions in non-school sports leagues (e.g. hockey in Canada)."*

*"Although the companies are mostly high-tech, the co-op roles are not just software developers. Co-ops are integrated into HR, marketing, and tech-writing teams. Talent, aptitude, and preferences all play a part in the roles students try to get."* - Source

The University of Limerick set up a degree a few years ago which was apparently partially inspired by UW. Stephen Kinsella is involved in running this. They have funding from the Collisons.

Other Canadian universities seem to also have their own co-op systems:

- University of Toronto
- A single 16 month placement

- Toronto Metropolitan University
- 4 or 5 coop terms adding up to 16 months of co-op

- Queen's University
- A single 16 month placement

- University of British Columbia
- SMU

Other Canadian universities to look into:

- McGill
- Calgary
- University of Victoria

In the US, Drexel University apparently has a substantial co-op programme.

Something which seems to make UW's programme particularly good is how they've built the degree around it. *"Undergraduate majors at UW are structured to provide the flexibility to take semesters off during your work terms, with many critical courses being offered during summer sessions. There are also very few year-long courses. There are also more opportunities to find placements at UW than there are at other schools".* - Source

Apparently employing co-op students is very tax-efficient for Canadian companies (on top of students probably being cheaper than graduates). Is there a policy lesson that other countries could take away from this?

*People underestimate the sheer number of people enrolled. The off-stream* (people doing a co-op term at a company are said to be "off-stream") *system allows for capacity for 40,000 students across undergrad/grad. Across engineering + CS, that's ~15,000 students* - Source

If there are 50 people on a programme and someone sets up a club, maybe 5 to 10 will show up.

- With a bigger cohort to draw from is it easier for societies and clubs to gain momentum?
- With more people, do you get clubs that go deeper into specific niches?These are the standard agglomeration benefits that urbanists and economists attribute to large dense cities.

An example of a club for makers at Waterloo: Socratica

- Velocity is a startup accelerator on the university campus. They have funded over 400 companies and have a 90,000-square-foot facility.
- The Perimeter Institute is up the road.

- https://thewalrus.ca/the-invention-of-waterloo
- This is an interesting piece. It was written at the height of Research in Motion (now Blackberry) so it has quite a bit on the huge donations in the area from the founders.

- https://uwaterloo.ca/computer-science/news/wes-graham-father-of-computing-at-waterloo
- https://marginalrevolution.com/marginalrevolution/2024/04/saturday-assorted-links-454.html#comments
- The first draft of this post was shared on Marginal Revolution and there were some interesting comments which I've incorporated

Eric Mazur is a professor of physics at Harvard whose students were getting perfectly adequate grades. One day though he decided to measure how much information they were retaining from his lectures. He found they largely forgot everything by the end of the lecture and even more by the time the next one came around.

So he started iterating on ways to turn his lectures into a more efficient use of his students' time. The process he ended up with looks like this:

- A few days before the lecture he sends the pupils the material that he wants them to learn this week. They study this in their own time.
- He also sends them a quiz with about 6 questions. The scores of the quiz contribute to a small proportion of the pupils' grades (~5%). This isn't because he's particularly concerned by how well the students do. He just wants to incentivise them to attempt them seriously.
- He uses the results of these quizzes to understand where the main areas of confusion are with the material. He prepares about 6 questions around these areas.
- In the actual lecture, he will put these questions up on the board one at a time and have the students vote for the answer they think is correct. Inevitably there will be some disagreement, but before explaining to the pupils why the correct answer is correct, he will get the pupils to explain to their neighbours why their answer is correct.

These mini-debates make the lecture an active use of the pupils' time and something they wouldn't get from watching a recording on their own. Furthermore, Mazur has found that students who have only just learnt the material can communicate with each other much better than he, who has long forgotten what it feels like to be unfamiliar with the material, can.

It's very silly that we make students sit passively listening to mediocre lecturers when they could watch and read the best material available on the internet, with the ability to rewind or speed up as appropriate. The in-person lecture time should be reserved for active engagement with the material with other people.

There's loads of evidence that tutoring is great. This surprises no one. But it's worth discussing what makes someone a really good tutor.

The best maths tutor and probably the best tutor of any subject I ever had was able to generate variations of problems on the fly which hinged on the exact point of misunderstanding I had. Lessons with him were exhausting but I came out of them with a vastly clearer understanding of the material.

But, obviously, tutors don't scale.

With LLMs, we can now ask questions about a specific thing we don't understand. We can also ask it to generate problems for us to tackle which require us to engage with the material.

How can we improve the performance of the LLM?

- We'll want to prompt it to have the understanding of a famous domain expert but to engage with us in the clearest way possible. Perhaps we want a chain of thought where it emphasises accuracy and then rewrites its output to emphasise clarity for a beginner.
- Long context windows allow us to load in chapters from relevant textbooks, and associated problem sets and answers. These could be directly given to the user, or used as examples for the LLM of problems we would like variations of.
- Using the internet to surface the best tutorials on a topic.
- Tool use with tools like Wolfram to validate proofs.

Richard Feynman is famous for his view that you don't fully understand something until you can explain it clearly to someone else. We can have our user explain a topic to the LLM where the LLM simulates a student who is new to the material.

]]>`scrapy startproject <project_name>`

This creates a file structure like so:

` scrapy.cfg <project_name> __init__.py items.py middlewares.py pipelines.py settings.py spiders __init__.py`

**settings.py**is where project settings are contained, like activating pipelines, middlewares etc. You can change the delays, concurrency, and lots more things.**items.py**is a model for the extracted data. You can define a custom model (like a ProductItem) that will inherit the Scrapy Item class and contain your scraped data.**pipelines.py**is where the item yielded by the spider gets passed, its mostly used to clean the text and connect to file outputs or databases (CSV, JSON SQL, etc).**middlewares.py**is useful when you want to modify how the request is made and scrapy handles the response.**scrapy.cfg**is a configuration file to change some deployment settings, etc.

Scrapy provides several different spider types. Some of the most common ones:

**Spider -**Takes a list of`start_urls`

and scrapes each one with a`parse`

method.**CrawlSpider -**Designed to crawl a full website by following any links it finds.**SitemapSpider -**Designed to extract URLs from a sitemap

To create a new generic spider, run:

`scrapy genspider <name_of_spider> <website>`

A new spider will now have been added to your`spiders`

folder, and it should look like this:

`import scrapy class NAMEOFSPIDERSpider(scrapy.Spider): name = 'NAMEOFSPIDER' allowed_domains = ['website'] start_urls = ['website'] def parse(self, response): pass`

This spider class contains:

**name**- an attribute that gives a name to the spider. We will use this when running our spider**allowed_domains**- an attribute that tells Scrapy that it should only ever scrape pages of the`<website>`

domain. This prevents the spider from going and scraping lots of websites. This is optional.**start_urls**- an attribute that tells Scrapy the first URL it should scrape.**parse**- thisfunction is called after a response has been received from the target website.

To start using this Spider we will have to:

- Change the
`start_urls`

to the URL we want to scrape - Insert our parsing code into the
`parse`

function

You run a spider with:

`scrapy crawl <name_of_spider>`

`scrapy shell`

If we run

`fetch(<start_url>)`

we should see a 200 response in the logs. Scrapy will save the HTML response in an object called `response`

You can get a list of elements matching a CSS selector by running

`response.css("<selector>")`

To just get the first matching element run

`response.css("<selector>").get()`

This returns all the HTML in this node of the DOM tree.

By dividing the curve up into segments we can have created a set of trapezia.

The area of each trapezium is the average of the heights of its two parallel sides multiplied by its width:

$\text{area} = \frac{y(x_1) + y(x_2)}{2}\cdot \Delta x$The total area under the curve is going to be the sum of the areas of these trapezia:

$\text{area} = \frac{y(1) + y(2)}{2}\cdot \Delta x + \frac{y(2) + y(3)}{2}\cdot \Delta x + \frac{y(3) + y(4)}{2}\cdot \Delta x + \frac{y(4) + y(5)}{2}\cdot \Delta x$We can factor out $\frac{\Delta x}{2}$ to get:

$\begin{aligned}\text{area} &= \frac{\Delta x}{2}(y(1) + y(2) + y(2) + y(3) + y(3) + y(4) + y(4) + y(5)) \\&= \frac{\Delta x}{2}(y(1) + 2y(2) + 2y(3) + 2(y(4) + y(5)))\end{aligned}$To generalise, we always have 2 of each of the middle terms and 1 of the inner and outer terms.

We could now evaluate this to get our approximation of the area under the curve between $x = 1$ and $x = 5$.

]]>Hamming makes two claims:

- Scientific knowledge doubles every 17 years
- 90% of scientists who have ever lived are now aliveHe makes these claims in order to give an example of back-of-the-envelope calculations that you can do as part of sense checking. In this case, we want to check if these claims are compatible with each other.

He begins by assuming that the number of scientists at any time $t$ is:

$y(t) = ae^{bt}$He also assumes that the amount of knowledge produced annually has a constant $k$ proportionality to the number of scientists alive. So we can write our equation for the amount of scientific knowledge produced in year $t$ as

$p(t) = kae^{bt}$We can then get the total amount of scientific knowledge by calculating the integral of this equation between the limits $-\infty$ and the current time $T$.

- The integral of $e^{bt}$ is $\frac{1}{b}e^t$ so when we multiply by the constants $ka$, the indefinite integral of $kae^{bt}$ is $\int_{} kae^{bt} dt = \frac{ka}{b}e^{bt} + C$
- At the lower limit, we can see from our plot that $e^{bt}$ approaches 0 as $t$ gets smaller and as the whole term is multiplied by $e^{bt}$, assuming that $b > 0$. This means that $\lim_{x\to-\infty}\frac{ka}{b}e^{bt} = 0$
- At the upper limit $t = T$, so $\frac{ka}{b}e^{bT}$
- The definite integral is the difference between the antiderivative evaluated at these points. In this case, it's a very straightforward sum $\frac{ka}{b}e^{bT} - 0 = \frac{ka}{b}e^{bT}$The process is exactly the same when finding the sum of knowledge up to 17 years ago, except our upper limit will be $\frac{ka}{b}e^{b(T - 17)}$.

So, to summarise:

$\begin{aligned}\int_{-\infty}^{T} kae^{bt} \ dt &= \frac{ka}{b}e^{bT}\\\int_{-\infty}^{T-17} kae^{bt} \ dt &= \frac{ka}{b}e^{b(T - 17)}\end{aligned}$Hamming's claim is that knowledge has been doubling every 17 years so we can say:

$\begin{aligned}\frac{1}{2} &= \frac{\int_{-\infty}^{T-17} kae^{bt} \, dt}{\int_{-\infty}^{T} kae^{bt} \, dt}\\\\&= \frac{\frac{ka}{b}e^{b(T-17)}}{\frac{ka}{b}e^{bT}}\\\\&= \frac{e^{b(T-17)}}{e^{bT}}\\\\&= e^{b(T-17) - bT} \\\\&= e^{-17b} \\\end{aligned}$Above we are using the law of exponents that dividing exponential expressions with the same base is equivalent to subtracting their exponents.

Hamming estimates the length of a scientific career to be 55 years. Using his original equation for the number of scientists in a given year $y(t) = ae^{bt}$ we can divide the integral for the equation up to the current year by the integral of the equation up to 55 years ago.

$\begin{aligned}\frac{\int_{T - 55}^{T}ae^{bt}dt}{\int_{-\infty}^{T}ae^{bt}dt} &= \frac{\frac{ka}{b}e^{bT} - \frac{ka}{b}e^{b(T - 55)}}{\frac{ka}{b}e^{bT} - 0}\\\\&= \frac{e^{bT} - e^{b(T - 55)}}{e^{bT}}\\\\&= 1 - e^{b(T - 55) - bT}\\\\&= 1 - e^{-55b}\end{aligned}$We can use our expression for the doubling of scientific knowledge $e^{-17b} = \frac{1}{2}$ to get the proportion of scientists alive today. We can use the law that $e^{kx} = (e^x)^k$.

$\begin{aligned}e^{-17b} &= \frac{1}{2}\\\\\left(e^{-17b}\right)^\frac{55}{17} &= \left(\frac{1}{2}\right)^\frac{55}{17}\\\\e^{-17b \cdot \frac{55}{17}} &= \left(\frac{1}{2}\right)^\frac{55}{17}\\\\e^{-55b} &= \left(\frac{1}{2}\right)^\frac{55}{17}\\\end{aligned}$Substituting this back into the equation:

$\begin{aligned}\frac{\int_{T - 55}^{T}ae^{bt}dt}{\int_{-\infty}^{T}ae^{bt}dt} &= 1 - \left(\frac{1}{2}\right)^\frac{55}{17}\\\\&= 0.894...\end{aligned}$This number is indeed very close to 90%.

Let's now come at the question from a different angle. Let's let $D$ be the doubling period and $L$ be the length of a scientific career.

The first equation becomes

$e^{-bD} = \frac{1}{2}$and the second becomes

$\begin{aligned}1 - e^{-bL} &= \frac{9}{10}\\\\1 - \left(\frac{1}{2}\right)^\frac{L}{D} &= \frac{9}{10}\\\\\left(\frac{1}{2}\right)^\frac{L}{D} &= \frac{1}{10}\\\\\ln\left(\left(\frac{1}{2}\right)^\frac{L}{D}\right) &= \ln\left(\frac{1}{10}\right)\\\\\frac{L}{D} \cdot \ln\left(\frac{1}{2}\right) &= \ln\left(\frac{1}{10}\right)\\\\\frac{L}{D} &= \frac{\ln\left(\frac{1}{10}\right)}{\ln\left(\frac{1}{2}\right)}\\\\\frac{L}{D} &= \frac{\ln(1) - \ln(10)}{\ln(1) - \ln(2)}\\\\\frac{L}{D} &= \frac{-\ln(10)}{-\ln(2)}\\\\\frac{L}{D} &= \frac{\ln(10)}{\ln(2)}\\\\\frac{L}{D} &= \log_{2}(10)\\\\&= 3.3219...\end{aligned}$Multiplying 3.3219 by our supposed doubling period of 17 years gives us 56.47 years for the average length of a scientific career, very close to Hamming's estimate of 55 years.

In this chapter, Hamming discusses growth models. The simplest growth model assumes the growth rate is proportional to the current size. For instance, in the case of compound interest. We can describe this model with a differential equation.

$\frac{dy}{dt} = ky$A differential equation is an equation that relates a function to its derivatives. In the context of growth models, differential equations are used to describe how something changes over time. The equation above is a first-order differential equation where $\frac{dt}{dy}$ represents the rate of change of $y$ with respect to time $t$, and $ky$ suggests that this rate of change is proportional to the current value of $y$. Here, $k$ is a constant of proportionality.

The solution to a differential equation is a function (or a set of functions) that satisfies the equation. This means that if you take the solution and its derivatives and plug them back into the original differential equation, the equation will hold. In other words, the left-hand side of the equation will equal the right-hand side for all points in the domain of the solution.

Hamming tells us the solution to the equation but skips over how to derive it. We do it like so:

- We start by rearranging the equation so that each variable is on a different side of the equation. $\frac{1}{y} \cdot dy = k \cdot dt$
- Next we integrate both sides of the equation $\ln(y) = kt + C$
- We can then exponentiate both sides of the equation to get rid of the natural logarithm. $e^{\ln(y)} = e^{kt + C}$
- This simplifies to $y = e^{kt} \cdot e^{C}$
- Since $e^C$ is just a constant we can represent it as just $A$. Thus we get the solution given by Hamming: $y(t) = Ae^{kt}$We can think of $A$ as representing the initial condition of the system. The equation $y(t) = Ae^{kt}$ then tells us how the quantity $y$ changes over time. If $k > 0$ we have growth. If $k < 0$ we have decay.

We can verify that this is a solution by:

- Differentiating the solution such that it is equal to the left-hand side of the differential equation (NB the derivate of $e^{kt}$ is $ke^{kt}$) $\frac{dy}{dt} = kAe^{kt}$
- Substituting the right-hand side of the solution into the right-hand side of the differential equation $ky = k(Ae^{kt})$We see that both sides of the equation match.

Hamming now updates this model of growth to include a limiting factor $L$.

$\frac{dy}{dt} = ky(L-y)$Hamming "reduces" the equation to a standard form, meaning we don't have to write the constants. He says let $y = Lz$ and $x = t(kL)$. Note that there is a typo in the book where they've written $\frac{t}{kL^2}$So substituting those in we get:

$\begin{aligned}\frac{dy}{dt} &= kLz(L - Lz) \\&= kL^{2}z(1 - z)\end{aligned}$We can get $\frac{dy}{dt}$ in terms of $\frac{dz}{dt}$ by differentiating $y = Lz$ with respect to $t$: $\frac{dy}{dt} = L\frac{dz}{dt}$Given $x = t(kL)$ we can find $\frac{dx}{dt}$:

$\begin{aligned}x &= t(kL) \\\frac{dx}{dt} &= kL\end{aligned}$We can use this to express $\frac{dz}{dt}$ in terms of $\frac{dz}{dx}$. The chain rule states that if we have a function $z(x(t))$, the derivative of $z$ with respect to $t$ will be $\frac{dz}{dt} = \frac{dz}{dx} \cdot \frac{dx}{dt}$. So we can say that:

$\begin{aligned}\frac{dz}{dt} &= \frac{dz}{dx} \cdot \frac{dx}{dt} \\&= \frac{dz}{dx} \cdot kL\end{aligned}$Going back to the earlier equation $\frac{dy}{dt} = L\frac{dz}{dt}$, we can now say:

$\begin{aligned}\frac{dy}{dt} &= L\frac{dz}{dt} \\kL^{2}z(1 - z) &= L (\frac{dz}{dx} \cdot kL) \\&= \frac{dz}{dx} \cdot kL^2 \\\frac{dz}{dx} &= z(1 - z) \\\end{aligned}$This is the standard form derived by Hamming.

Suppose we wanted to integrate this equation to find $z$ in terms of $x$. We might first rearrange it to separate the variables so it looks like this: $\frac{1}{z(1 - z)}dz = dx$The left-hand side is a complex fraction. To make it easier to integrate, Hamming uses partial fractions. This means:

- Expressing $\frac{1}{z(1-z)}$ as a sum of simpler fractions $\frac{A}{z}$ and $\frac{B}{1-z}$
- Multiplying through the common denominator $z(1-z)$
- Setting $z$ to various values to solve for $A$ and $B$. In this case, we will use 0 and 1

This is much simpler to integrate. We know that the derivative of $\ln(x)$ is $\frac{1}{x}$ so $\int{\frac{1}{z}} = \ln(z)$. We have to remember to apply the chain rule when integrating $\frac{1}{1 - z}$ though. We can do this with substitution.

$\begin{aligned}u &= 1 - z \\du &= -dz \\dz &= -du \\\int{\frac{1}{1 - z}} &= \int{\frac{1}{u} \cdot -du} \\&= -\int{\frac{1}{u}du} \\&= -\ln(u) + C \\&= -ln(1 - z) + C\end{aligned}$Therefore in summary:

$\begin{aligned}\int{\frac{1}{z} + \frac{1}{1 - z} dz} &= \int{dx} \\\\\ln{(z)} - \ln{(1 - z)} &= x + C\end{aligned}$We can use the law of logarithms that $\ln(x) - \ln(y) = \ln(\frac{x}{y})$. So:

$\begin{aligned}\ln(\frac{z}{1 - z}) &= x + C \\\frac{z}{1 - z} &= e^{x + C}\end{aligned}$Since $e^{x+C} = e^x \cdot e^C$ and $e^C$ is just a constant, we can replace it with a new constant which we'll call $A$. So we now have:

$\begin{aligned}\frac{z}{1 - z} &= Ae^x \\\end{aligned}$We can solve for $z$ like so:

$\begin{aligned}\frac{z}{1 - z} &= Ae^x \\z &= Ae^x(1 - z) \\z &= Ae^x - Ae^x \cdot z \\z + Ae^x \cdot z &= Ae^x \\z(1 + Ae^x) &= Ae^x \\z &= \frac{Ae^x}{1 + Ae^x}\end{aligned}$To get the answer in the form given by Hamming we can divide the numerator and denominator by $Ae^x$

$\begin{aligned}z &= \frac{Ae^x}{1 + Ae^x} \\\\&= \frac{\frac{Ae^x}{Ae^x}}{\frac{1}{Ae^x} + \frac{Ae^x}{Ae^x}} \\\\&= \frac{1}{1 + \frac{1}{Ae^x}} \\\\&= \frac{1}{1 + (\frac{1}{A})e^{-x}}\end{aligned}$As Hamming points out, $A$ is determined by the initial conditions. By this, he means where you set $t$ or $x$ equal to 0. As $x$ approaches $-\infty$, the denominator will get larger and $z$ will approach 0. As it gets bigger, $(\frac{1}{A})e^{-x}$ will approach 0 and $z$ will approach 1.

Hamming shows us a more flexible model for growth $\frac{dz}{dx} = z^a(1 - z)^b,\ \ (a, b > 0)$We can plot growth curves for different values of $a$ and $b$ to see how they change how the model behaves:We can find $z$ by separation of variables and integration. We can also find the steepest slope by differentiating the right-hand side and setting it equal to 0. To differentiate we use the product rule: $\frac{d(uv)}{dz} = u \cdot \frac{dv}{dz} + v \cdot \frac{du}{dz}$Hence:

$\begin{aligned}\frac{d}{dz}[z^a(1 - z)^b] &= a \cdot z^{a-1} \cdot (1 -z)^b + z^a \cdot b \cdot (1 - z)^{b - 1} \cdot (-1) = 0 \\&= a \cdot z^{a-1} \cdot (1 -z)^b - z^a \cdot b \cdot (1 - z)^{b - 1} = 0\\&= z^{a - 1} \cdot (1 - z)^{b - 1} \cdot (a(1 - z) - bz) = 0 \\&= a(1 - z) - bz = 0\end{aligned}$Notice how we can factor out the terms $z^{a-1}$ and $(1 - z)^{b-1}$ in line 3 above. It took me a while to see this but it's obvious when you think about it that e.g. $x^{y - 1} * x = x^y$.

From here it's easy to solve for $z$:

$\begin{aligned}a(1 - z) - bz &= 0 \\a - az - bz &= 0 \\a - z(a + b) &= 0 \\a &= z(a + b) \\z &= \frac{a}{a + b}\end{aligned}$Substituting this value of $z$ back into the original differential equation $\frac{dz}{dx} = z^a(1 - z)^b$ gives us

$\begin{aligned}\frac{dz}{dx} &= \left(\frac{a}{a + b}\right)^a\left(1 - \frac{a}{a + b}\right)^b \\&= \left(\frac{a}{a + b}\right)^a\left(\frac{a + b}{a + b} - \frac{a}{a + b}\right)^b \\&= \left(\frac{a}{a + b}\right)^a\left(\frac{b}{a + b}\right)^b \\&= \frac{a^ab^b}{(a+b)^{a+b}} \\\end{aligned}$This expression represents the slope of the curve at the point $z = \frac{a}{a + b}$ which is the steepest point of the curve. In the context of a growth model, this is the maximum growth rate.

Hamming draws our attention to two special cases. When $a = b$, the maximum slope will be:

$\begin{aligned}\frac{a^ab^b}{(a+b)^{a+b}} &= \frac{a^aa^a}{(a+a)^{a+a}} \\&= \frac{a^{2a}}{(2a)^{2a}} \\&= \frac{a^{2a}}{2^{2a}a^{2a}} \\&= \frac{1}{2^{2a}} \\&= 2^{-2a} \\\end{aligned}$When $a = b = \frac{1}{2}$ our differential equation will be

$\begin{aligned}\frac{dz}{dx} &= z^a(1 - z)^b \\&= z^\frac{1}{2}(1 - z)^\frac{1}{2} \\&= \sqrt{z(1 - z)} \\\frac{dz}{\sqrt{z(1 - z)}} &= dx \\\end{aligned}$We can integrate this by making a trigonometric substitution $z = \sin^2(\theta)$. Differentiating this with the chain rule tells us that $\frac{dz}{d\theta} = 2\sin(\theta)\cos(\theta)$ and $dz = 2\sin(\theta)\cos(\theta)d\theta$. Substituting this back into the differential equation gives:

$\begin{aligned}\frac{2\sin(\theta)\cos(\theta)d\theta}{\sqrt{\sin^2(\theta)(1 - \sin^2(\theta))}} &= dx \\\frac{2\sin(\theta)\cos(\theta)d\theta}{\sqrt{\sin^2(\theta)\cos^2(\theta)}} &= dx \\\frac{2\sin(\theta)\cos(\theta)d\theta}{\sin(\theta)\cos(\theta)} &= dx \\2d\theta &= dx \\\int{2d\theta} &= \int{dx} \\2\theta &= x + C \\\theta &= \frac{x + C}{2} \\\end{aligned}$Having found $\theta$, we can substitute it back into $z = \sin^2(\theta)$ to get:$z = \sin^2(\frac{x}{2} + C), (-C \le \frac{x}{2} \le \frac{\pi}{2} - C)$Hamming tells us that the solution curve has a finite range. We can see that because $\sin^2(\theta)$ is always within 0 and 1. The solution is valid for $\theta$ such that $\sin(\theta)$ is real and non-negative. Hence the bounds $-C \le \frac{x}{2} \le \frac{\pi}{2} - C$.

Hamming begins chapter 9 by reminding us that we can extend the Pythagorean theorem into higher dimensions because the square of the diagonal is the sum of the squares of the individual mutually perpendicular sides $D^2 = \sum^n_{i=1}{x^2_i}$ where $x_i$ are the lengths of the sides of the rectangular block in $n$ dimensions.

Next, he derives the Stirling approximation for $n!$. This is especially useful for large factorials. It also becomes increasingly accurate as $n$ increases. He starts by taking the natural log of $n!$ to get $\ln(n!) = \sum^n_{k=1}{\ln(k)}$He then finds the integral $\int^n_1\ln(x)dx$ by using integration by parts. This is a technique that comes from the product rule of differentiation. It is given by the formula $\int{udv} = uv - \int{vdu}$Hamming sets $u = \ln{x}$ and $dv = dx$. It therefore follows that $du = \frac{1}{x}dx$ and $v = \int{dv} = \int{dx} = x$. Substituting this into the integration by parts formula we get:

$\begin{aligned}\int^n_1{\ln(x)dx} &= \ln(x)x - \int{x}\frac{1}{x}dx \\&= \ln(x)x - \int{1dx} \\&= \ln(x)x - x \\&= (n\ln(n) - n) - (1\ln(1) - 1) \\&= n\ln(n) - n + 1\end{aligned}$Hamming also shows us how we could use the trapezium rule to approximate the integral. (See my trapezium rule notes for how we get this formula).

$\int^n_1{\ln{x}dx} \approx \frac{1}{2}\ln{1} + \ln{2} + \ln{3} +\ ...\ + \frac{1}{2}\ln{n}$Note that he appears to be assuming that we have divided the curve into $n - 1$ segments which would result in our term for the width of the trapeziums $\Delta x$ being equal to 1. That would explain why we don't see it in the equation above

Since $\ln{1} = 0$, we can simplify this to $\int^n_1{\ln{x}dx} \approx \ln{2} + \ln{3} +\ ...\ + \frac{1}{2}\ln{n}$It is a property of logarithms that the sum of logarithms is approximately equal to the logarithm of the product of terms. Thus the sum of $\ln{2} + \ln{3} +\ ...\ + \frac{1}{2}\ln{n}$ can be approximated as $\ln(n!)$.

The Stirling approximation of $n!$ is $n^n e^{-n} \sqrt{2\pi n}$. Taking the log of this gets us: $ln(n!) \approx n\ln(n) - n + \ln(\sqrt{2 \pi n})$The term $\ln{\sqrt{2\pi n}}$ is often neglected in rough approximations, leading to: $ln(n!) \approx n\ln(n) - n$Hamming adds a term $\frac{1}{2}\ln{n}$ to account for the half contribution of the endpoint $n$. He there is also a term $+1$ in his final result. ChatGPT suggests that it may be an adjustment or correction factor to improve the accuracy of the approximation for specific ranges of $n$. In some numerical approximations, especially when dealing with sums and series, such correction factors are introduced to fine-tune the approximation, particularly for smaller values of $n$ where Stirling's approximation (which is more accurate for large $n$) may not be as precise. Either way

$\sum^n_{k=1}\ln{k} \approx n\ln{n} - n + 1 + \frac{1}{2}\ln{n}$Undoing the logs by taking the exponential of each side gives:

$\ln{n}$ to both terms, we get, finally:

$\sum^n_{k=1}\ln{k} \approx n\ln{n} - n + 1 + \frac{1}{2}\ln{n}$Undoing the logs by taking the exponential of each side gives: $n! \approx Cn^ne^{-n}\sqrt{n}$$C$ is a constant (not far from $e$) independent of $n$ since we are approximating an integral by the trapezium rule and the error in the trapezium approximation increases more slowly as $n$ grows larger, and as $C$ is the limiting value.

This is the first form of Stirling's formula. Hamming skips deriving the limiting, at infinity, value of $C$ which is $\sqrt{2\pi} = 2.5066...$ ($e = 2.71828...$). However, doing so would show us how we get the usual Stirling's formula for the factorial $n! \approx n^ne^{-n}\sqrt{2 \pi n}$Hamming provides the following table to give us a sense of the quality of the Stirling approximation.

$\begin{array}{l l l l} \hline n & \text{Stirling} & \text{True} & \text{Stirling/True} \\ \hline 1 & 0.92214 & 1 & 0.92214 \\ 2 & 1.91900 & 2 & 0.95950 \\ 3 & 5.83621 & 6 & 0.97270 \\ 4 & 23.50618 & 24 & 0.97942 \\ 5 & 118.01917 & 120 & 0.98349 \\ 6 & 710.07818 & 720 & 0.98622 \\ 7 & 4980.3958 & 5040 & 0.98817 \\ 8 & 39902.3955 & 40320 & 0.98964 \\ 9 & 359536.87 & 362880 & 0.99079 \\ 10 & 3598695.6 & 3628800 & 0.99170 \\ \hline \end{array}$He notes that as the numbers get larger, the ratio approaches 1 but the absolute differences get greater. Consider the two functions:

$\begin{aligned}f(n) &= n + \sqrt{n} \\g(n) &= n\end{aligned}$The limit of the ratio $\frac{f(n)}{g(n)}$, as $n$ approaches infinity, is 1. But the difference $f(n) - g(n) = \sqrt{n}$ grows larger as $n$ increases.

Hamming introduces the *gamma function* in the form of the integral

which he tells us converges for all $n > 0$.

For $n > 1$ we integrate by parts again. We use

$\begin{aligned}dv &= e^{-x} \\u &= x^{n-1}\end{aligned}$Hamming tells us that at the two limits, the integrated part is 0. This is because as $x \to \infty$ $e^{-x}$ tends towards 0 while as $x \to 0$ $x^{n-1}$ will tend towards 0 (remember this is for $n > 1$).

The integration by parts formula is:

$\int{udv} = uv - \int{vdu}$We can also quickly work out that

$\begin{aligned}du &= (n - 1)x^{n - 2}dx \\v &= -e^{-x}\end{aligned}$Hamming tells us that at the limits where the integrated part is 0 we have the reduction formula:

$\Gamma(n) = (n - 1)\Gamma(n - 1)$with $\Gamma(1) = 1$

]]>**Is row 1, column 2 a Nash equilibrium? (In all the strategic form games in these problems, the payoff of the person selecting the row is given first.)**

No.

In game theory, a Nash equilibrium for a two-player game in normal form is a pair of strategies $(A,B)$ such that no player has incentive to unilaterally change her strategy. Formally, a strategy pair $(A, B)$ is a Nash equilibrium if:

$U_1(A, B) \geq U_1(A', B) \quad \text{for all } A' \text{ in the strategy set of player 1}$$U_2(A, B) \geq U_2(A, B') \quad \text{for all } B' \text{ in the strategy set of player 2}$

Where $U_1$ and $U_2$ are the utility functions for player 1 and player 2, respectively. $A'$ and $B'$ refer to alternative strategies they could pursue.

For the row picking player, the best response to column 2 is row 2, not row 1.

**Find all the Nash equilibria in the following game**

In looking for Nash equilibria, we consider all possible strategies for both players, not just the ones that yield the highest payoffs in isolation. This is because a Nash equilibrium is defined as a situation where neither player has an incentive to unilaterally deviate from their current strategy, given the other player's strategy.

**Row 1, Column 2 as a Nash Equilibrium**:- If Row chooses row 1, the best response for Column is column 2 (payoff 2), and if Column chooses column 2, the best response for Row is row 1 (payoff 3). Neither has an incentive to deviate, so this is a Nash equilibrium.

**Row 2, Column 1 as a Nash Equilibrium**:- If Row chooses row 2, the best response for Column is column 1 (payoff 10), and if Column chooses column 1, the best response for Row is row 2 (payoff 5). Again, neither has an incentive to deviate, so this is a Nash equilibrium.

**Row 3, Column 3 as a Nash Equilibrium**:- If Row chooses row 3, the best response for Column is column 3 (payoff 5), and if Column chooses column 3, the best response for Row is row 3 (payoff 10). Neither has an incentive to deviate, so this is a Nash equilibrium.

**Find all the Nash equilibria in the following game**

Row 2 Column 2 and Row 4 Column 4. Following the same process as above...

- If Row chooses row 1, Column will choose either column 1 or 2, either way Row will then choose row 2. Column will then chose column 2. So row 2, column 2 is a Nash equilibrium.
- If Row chooses row 2, Column will choose column 2, row will then choose row 2. So we come to the same equilibrium as before.
- If Row chooses row 3, Column will choose column 1, Row will then choose row 2, Column will then choose column 2. So we are again at the same equilibrium as before.
- If Row chooses row 4, Column will choose column 3, Row will then stick with row 3. So this is also a Nash equilibrium.

**Apply iterated dominance to the following game**

Iterated dominance is a process used to simplify the strategic form of a game by iteratively eliminating dominated strategies. A strategy $A$ is said to be dominated if there is another strategy $A'$ that yields a higher payoff for all possible strategies chosen by the opponent.

If you find a strategy that is strictly dominated, you can remove it from the table. If this then results in another strategy becoming strictly denominated by another you can elimate that as well and so on.

Column 2 is dominated by column 4 because $1 < 3$, $1 < 2$, $0 < 1$ so can remove it:

$\begin{array}{c|c|c} & \text{column 1} & \text{column 3} & \text{column 4} \\ \hline \text{row 1} & 6,1 & 5,2 & 2,3 \\ \hline \text{row 2} & 8,0 & 4,5 & 1,2 \\ \hline \text{row 3} & 4,4 & 3,0 & 1,1\end{array}$Now row 3 is dominated by row 1 so we can remove it

$\begin{array}{c|c|c} & \text{column 1} & \text{column 3} & \text{column 4} \\ \hline \text{row 1} & 6,1 & 5,2 & 2,3 \\ \hline \text{row 2} & 8,0 & 4,5 & 1,2\end{array}$Now column 1 is dominated by column 3 so we remove it

$\begin{array}{c|c} & \text{column 3} & \text{column 4} \\ \hline \text{row 1} & 5,2 & 2,3 \\ \hline \text{row 2} & 4,5 & 1,2\end{array}$Now row 2 is dominated by row 2 so we remove it

$\begin{array}{c|c} & \text{column 3} & \text{column 4} \\ \hline \text{row 1} & 5,2 & 2,3\end{array}$Finally column 3 is dominated by column 4 and we are left with our equilibrium payoffs

$\begin{array}{c|c} & \text{column 4} \\ \hline \text{row 1} & 2,3\end{array}$When a game is dominance solvable using (at each step) strict (iterated) dominance, what remains is the unique Nash equilibrium of the game. More generally, any strategy eliminated by iterated strict dominance cannot be part of any Nash equilibrium.

**Apply iterated dominance to the following game**

In this game, there is no immediate strict dominance of any row or column.

Column 4 is weaky dominated by columns 1 and 2 and row 3 is weakly dominated by row 1. So we could remove column 4 and row 3

$\begin{array}{c|c|c} & \text{column 1} & \text{column 2} & \text{column 3} \\ \hline \text{row 1} & 1,9 & 2,9 & 2,8 \\ \hline \text{row 2} & 3,3 & 4,4 & 1,1 \\ \hline \text{row 4} & 2,2 & 0,0 & 3,3\end{array}$We probably shouldn't proceed any futher here. In game theory, a strategy is said to "weakly dominate" another if it is at least as good in all scenarios and better in at least one. Iterated dominance generally refers to the iterative elimination of strictly dominated strategies, not weakly dominated ones. While some forms of iterated dominance can include weak dominance, it's often avoided for a couple of reasons:

**Ambiguity**: Weakly dominated strategies can sometimes be part of a Nash equilibrium. Eliminating them might remove some Nash equilibria from consideration, thus making the analysis less robust.**Complexity**: Including weak dominance can complicate the analysis and make it more difficult to find a clear, unequivocal solution.

In the real world the decision on whether or not to proceed would probably be decided by the emperical evidence available to you.

**Imagine you are taking part in an auction, where the object being auctioned is a vacation trip. There are 15 other prospective buyers in addition to you. You have determined that the trip is worth $2000 to you: You would rather have the trip and pay some amount less than $2000 than to miss the trip (and pay nothing), but you would rather miss the trip (and pay nothing) than take the trip if it costs more than $2000. You are indifferent between missing the trip and paying nothing and going on the trip if it costs $2000.**

**To be very specific, your payoff is**

**0 if you do not win the auction (and pay nothing)****$2000 - P$ if you win the trip and pay $P$.**

**You have very little idea how much the trip is worth to the other 15 bidders or how they bid.**

**Suppose this is a first-price auction. Why does the strategy of bidding $1950 weakly dominate the strategy of bidding $2000 for you? Can you compare (using dominance) bidding $1950 or bidding $1960? Can you compare (using dominance) bidding $2000 and bidding an amount more than $2000?**

In a first-price auction, the highest bidder wins the item and pays the amount they bid.

Bidding $1950 vs. $2000:

- If you win at $1950, your payoff is $2000 - 1950 = 50$
- If you win at $2000, your payoff is $2000 - 2000 = 0$

Clearly, the payoff from winning at $1950 is better than or equal to winning at $2000 in every scenario, and it's strictly better in at least one scenario (when you win).

- If you lose at both $1950 and $2000, your payoff is 0 in either case.

Again, the payoff from bidding $1950 is at least as good as bidding $2000.

So, we can conclude that the strategy of bidding $1950 weakly dominates the strategy of bidding $2000.

Bidding $1950 vs. $1960:

- If you win at $1950, your payoff is $2000 - 1950 = 50$
- If you win at $1960, your payoff is $2000 - 1960 = 40$

Neither of these strictly dominates the other because the outcome depends on the bids of the other players. If the second-highest bid is between $1950 and $1960, then bidding $1960 would win you the auction while $1950 would not. However, you'd prefer to win at $1950 if possible due to the higher payoff. In this case, we can't say that one strategy dominates the other strictly or weakly; they are simply different strategies with different risks and rewards.

Bidding $2000 vs. Bidding more than $2000:

- If you win at $2000, your payoff is $2000 - 2000 = 0$.
- If you win at more than $2000 (say, $2050), your payoff would be negative (e.g. $2000 - 2050 = -50$).

Here, bidding $2000 strictly dominates bidding more than $2000 because in all scenarios, your payoff from bidding $2000 is at least as good as bidding more than $2000, and in some scenarios (when you win), it's strictly better.

**Suppose this is a second-price (Vickery) auction. Why does the strategy of bidding $2000 weakly dominate every other strategy for you?**

In a second-price auction, the highest bidder wins the item but pays the amount of the second-highest bid. Bidders have an incentive to bid their true valuation because they know they will only pay the second-highest price if they win, which will always be less than or equal to their own bid (and therefore less than or equal to their valuation).

Let's consider why bidding your true valuation of $2000 weakly dominates every other strategy for you:

- If you bid less than $2000 (say, $1950) and win:
- The second-highest bid must be less than or equal to $1950. You would have won even if you bid $2000, but by bidding less than your true valuation, you risk losing the auction to someone who might bid between $1950 and $2000, a range where you'd still consider the item worth buying.

- If you bid $2000 and win:
- You pay the second-highest price, which is less than or equal to $2000. This is your true valuation, so you are indifferent or happy with this outcome.

- If you bid more than $2000 (say, $2050) and win:
- You risk overpaying for the item. If the second-highest bid is between $2000 and $2050, you end up paying more than your valuation, which is undesirable.

- If you lose the auction:
- Your payoff is zero, regardless of what you bid, as long as the bid is less than or equal to $2000.

Therefore, by bidding your true valuation ($2000), you ensure that you win the auction whenever it's beneficial for you to do so (i.e., when the second-highest bid is less than $2000). You also avoid the risk of overpaying or underbidding. Hence, bidding $2000 weakly dominates all other strategies in a second-price auction for you.

**Here are two extensive-form games of complete and perfect information: the threat game and the trust game. Solve each by backward induction. Then, do you think that your peers, playing the games in, say, units of $1 equals one unit of payoff, would follow the prediction of the Nash equilibrium analysis?**

If A is challenged, it will acquiesce. So B chooses between challenging and getting 1, and not challenging and getting 0. B will challenge A, and A will acquiesce.

If B trusts A, A will act abusively (2 > 1). So B must choose between trust, getting -1 for itself, and no trust, which nets it 0. It will not trust A, and A will have no opportunity to move.

**Imagine two firms, labeled $A$ and $B$, producing products that are substitutes but not perfect substitutes. The inverse demand functions for their two goods are $p_A = a - x_A - bx_B$ and $p_B = a - x_B - bx_A$ for a positive constant $a$ and for $0 < b < 1$, with the same constants $a$ and $b$ appearing in both inverse demand functions. Each firm has a constant marginal cost of production $c$.**

**Suppose the two firms must simultaneously and independently choose quantities to produce, each without knowing what the other has chosen. What are (or is) the Nash equilibria of this game?**

In plain English, the inverse demand function $p_A = a - x_A - bx_B$ says that the price $p$ firm $A$ can sell it's good is determined by:

- The postive constant $a$. This represents the intercept of the inverse demand curve. It could be interpreted as the maximum price consumers are willing to pay when no units of either good are produced.
- The quantity of the good firm $A$ produces is given by the term $x_A$. This value is negative as the more of a good is produced, the lower will be its price.
- The quantity of the good firm $B$ produces is given by the term $x_B$.This value is negative for the same reason as $x_A$. It is mutliplied by the term $b$ which effectively weights the effect of $x_B$ by how similar the two goods are to each other. i.e. if the two goods are actually quite dissimilar, the effect of firm $B$ making more will be quite small.

We want to know to know the equilibrium values for $x_A$ and $x_B$.

Let's start by writing down a pair of equations to describe each firm's profit, the profit functions. Intially we could say that each firm's profit will be the price they sell their goods minus the cost of manufacturing them, all multiplied by the quantity that is manufactured:

$\pi_A = (p_A - c)x_A \\\pi_B = (p_B - c)x_B$Now as described in the question above, the prices of $A$ and $B$'s goods are given by their inverse demand functions. So we can subsitute them into the profit functions:

$\begin{aligned}\pi_A &= (a - x_A - bx_B - c)x_A \\&= a \cdot x_A - {x_A}^2 - bx_B \cdot x_A - c \cdot x_A \\&= (a - bx_B - c)x_A - {x_A}^2 \\\\\pi_B &= (a - x_B - bx_A - c)x_B \\&= a \cdot x_B - {x_B}^2 - bx_A \cdot x_B - c \cdot x_B \\&= (a - bx_A - c)x_B - {x_B}^2\end{aligned}$In order to maximise their profits, each firm will produce a quantity such that it would make make less profit if it made any more or any less. If we imagine plotting the profit functions for various quantities, the peaks of the curves will be where their derivatives are 0.

So we can find out what those quantities $x_A$ and $x_B$ will be by calculating the derivatives, setting them equal to 0, and solving for for their respective own quantity terms. These are known as reaction functions (and also as first-order conditions for profit maximisation) as they describe the the quantity a firm will produce to maximise its profit in response to the quantity produced by the other firm.

$\begin{aligned}{\pi_A}' &= a - bx_B - c - 2x_A \\0 &= a - bx_B - c - 2x_A \\x_A &= \frac{a - bx_B - c}{2} \\\\{\pi_B}' &= a - bx_A - c - 2x_B \\0 &= a - bx_A - c - 2x_B \\x_B &= \frac{a - bx_A - c}{2}\end{aligned}$Finally to find the Nash equilibrium it we solve the reaction functions simultaneously. We'll substitute the reaction function for x_A into the reaction function for $x_B$ and solve for $x_B$.

$\begin{aligned}x_B &= \frac{(a - c)}{2} - \frac{b(\frac{a - bx_B - c}{2})}{2} \\&= (\frac{a}{2} - \frac{c}{2}) + (-\frac{ab}{4} + \frac{bc}{4} + \frac{b^2x_B}{4}) \\&= \frac{a - c}{2} - \frac{b(a - c)}{4} + \frac{b^2x_B}{4} \\x_B - \frac{b^2x_B}{4} &= \frac{a - c}{2} - \frac{b(a - c)}{4} \\x_B(1 - \frac{b^2}{4}) &= \frac{a - c}{2} - \frac{b(a - c)}{4} \\x_B &= \frac{\frac{a - c}{2} - \frac{b(a - c)}{4}}{1 - \frac{b^2}{4}} \\&= \frac{\frac{2(a - c) - b(a - c)}{4}}{1 - \frac{b^2}{4}} \\&= \frac{\frac{(2 - b)(a - c)}{4}}{1 - \frac{b^2}{4}} \\&= \frac{\frac{(2 - b)(a - c)}{4}}{\frac{4 - b^2}{4}} \\&= \frac{(2 - b)(a - c)}{4 - b^2} \\&= \frac{(2 - b)(a - c)}{(2 + b)(2 - b)} \\&= \frac{a - c}{b + 2}\end{aligned}$We then can then subsitute our result for $x_B$ into the reaction function for $x_A$.

$\begin{aligned}x_A &= \frac{a - c}{2} - \frac{b(a - c)}{2(b + 2)} \\&= \frac{(a - c)(b + 2) - b(a - c)}{2(b + 2)} \\&= \frac{ab + 2a - bc - 2c - ab + bc}{2(b + 2)} \\&= \frac{2a - 2c}{2(b + 2)} \\&= \frac{2(a - c)}{2(b + 2)} \\&= \frac{a - c}{b + 2}\end{aligned}$This implies that in the Nash equilibrium, both firms will produce the same quantity of output, which is given by the expression $\frac{a - c}{b + 2}$. This result is consistent with the symmetric nature of the Cournot competition model when the firms have identical cost structures and face the same demand conditions.

We can plot a visualisation of this result like so. Note that in this plot we are assuming that $a = 10$, $b = 0.5$, and $c = 2$.

What is this showing us?

As the quantity produced by firm $B$ decreases, the optimal quantity for firm $A$ to make increases. If firm $B$ makes nothing at all the optimal quantity for firm A to make is:

$\begin{aligned}x_A &= \frac{a - bx_B - c}{2} \\&= \frac{a - b \cdot 0 - c}{2} \\&= \frac{a - c}{2}\end{aligned}$Substituting our example values gives us $\frac{10 - 2}{2} = 4$ and indeed we can see that $x_A$ is 4 when $x_B$ is 0.

As the amount produced by firm $B$ increases, the optimal quantity form firm $A$ to produce decreases. At some point the optimal quantity for firm $A$ to make will be 0. Setting $x_A$ to 0 and rearranging to solve for $x_B$ shows us how much firm $B$ would have to make for this to be the case.

$\begin{aligned}x_A &= \frac{a - bx_B - c}{2} \\0 &= \frac{a - bx_B - c}{2} \\0 &= a - bx_B - c \\bx_B &= a - c \\x_B &= \frac{a - c}{b}\end{aligned}$Substituting in our example values gives us $\frac{10 - 2}{0.5} = 16$ and indeed we can see that when $x_B$ is 16 $x_A$ is 0.

Of course, the same principles hold if with swap $A$ and $B$ around.

**Suppose that the two firms must simultaneously and independently choose prices to charge, each without knowing what price the other has chosen. What are (or is) the Nash equilibria of this game?**

First we find invert the inverse demand functions to get the demand functions.

$p_A = a - x_A - bx_B \\ p_B = a - x_B - bx_A$We start by isolating the $x$ terms in each equation

$x_A = a - p_A - bx_B \\ x_B = a - p_B - bx_A$We can then substitute the expression for $x_B$ into the expression for $x_A$

$\begin{aligned}x_A &= a - p_A - b(a - p_B - bx_A) \\&= a - p_A - ab + bp_B + b^2x_A \\x_A - b^2x_A &= a - p_A - ab - bp_B \\x_A(1 - b^2) &= a - p_A - ab + bp_B \\x_A &= \frac{a - p_A - ab + bp_B}{1 - b^2} \\x_A &= \frac{a(1 - b) - p_A + bp_B}{1 - b^2}\end{aligned}$