A Changing Canada

I remember when I was a kid and hearing that there were four billion people in the world. I never thought about it much until I learned that there are now over 7.7 billion. When did that happen? What else has changed? Seeing change is hard, especially if it happens slowly. To visualize how things change I created a dashboard-like view of six broad indicators. To put each statistic in context, it often helps to have other related things to compare it to, such as other countries, or average or historical values. [Read More]

Inequality in Canada

Inequality has been in the news a lot recently. What is it exactly and is it just an American thing? There are many types of inequality: Inequality of income - how income is distributed throughout a society Inequality of wealth - how wealth is distributed throughout a society Inequality of opportunity - someone’s ability to get an education and a job - their potential to succeed - often is determined by elements that they had no control over, their: gender, ethnicity, place of birth, economic circumstance, parental background. [Read More]

Mighty Morphin' Letters

Apropos of nothing I was thinking about how impressed I was when I first saw the morphing faces in Michael Jackson’s Black or White 1991 short film (face morph begins at 5:27) directed by John Landis. Then I saw Thomas Lin Pedersen’s transformr package and thought I’d play around a little. The result is here. The slower the cooler it looks, but the longer the wait to generate the animation. Enjoy. [Read More]

The Travelling Salesman

Ontario has 413 uniquely named municipalities comprising 99.3% of its total population of 13,448,494 (2016). Suppose you wanted to visit each of them in your jet-powered helicopter starting from Toronto. What order of cities results in the shortest total path? This is variation on the classic travelling salesman problem (TSP) that has intrigued and bedevilled computational mathematicians for years. It is the rare mathematical challenge that is understandable by everyone and yet efforts to solve it have involved computer science, complexity theory, optimization theory and linear programming and influenced fields as diverse as logistics, genetics, manufacturing, telecommunications, astronomy, and neuroscience. [Read More]

Where Do Refugees Go?

Hint: It's Not North America

Imagine you’ve been forced from your home and country for fear for your life. Unbeknownst to you you are joining twenty million fellow travellers in a quest for safety. You quickly realize that you have three choices. Join a UNHCR sponsored refugee camp where you will be sheltered and fed but usually not allowed to work for fear of driving down domestic wages - living a life on hold. Live in urban areas without support and work illegally and potentially face exploitation. [Read More]

The Beauty of Strange Attractors

Dynamic systems are those where something changes over time according to a set of rules. They are found in many fields of study including, physics, chemistry, geology, biology and economics. Examples include, the planets orbiting around the sun, the vibration of an airplane wing, and the diffusion of drugs in your body. In mathematics, the something that changes over time can be points in a plane that change according to the rules of a function, which in a general form looks like this: [Read More]

Mapping Trees in Toronto

As cities go, Toronto is often ranked as one of the greener ones. The city has a database of trees that reside mostly on public land and consists of more than 560,000 trees and 246 species. I used Shiny and Leaflet-R to visualize the distribution of different species across the city. You can see it here. The drop down allows you to select tree species by common name or Latin name. [Read More]

Tree Taxonomy in Toronto

The city of Toronto has a large (> 567,000) database of the trees that live on public land. There are 246 types of trees and shrubs in Toronto, which is about one quarter of all the tree species in North America. However tropical forests win the diversity crown with tens of thousands of species. Usually when you start to look at a new dataset its a good idea to look at its overall structure. [Read More]