Showing posts with label Mathematics. Show all posts
Showing posts with label Mathematics. Show all posts

Thursday, December 08, 2022

Urban trees and the zombie carbon sequestration myth

Last summer, my city passed a tree protection ordinance that fines people for removing trees--even those on private property in side or back yards (where they don't shade public sidewalks or road asphalt). It was sent for legal review and will come back on December 20, 2022 for final passage. 

I'm not a lawyer, but I will say as a scientist that it is claptrap. 

So much nonsense was spewed that would fly under the radar of people not in the trenches of housing policy. I suspect that using the need for street trees to push through a more expansive policy is designed to make infill housing (eg ADUs*enabled by SB 9) harder or more prohibitively expensive to build. 

But, I want to push back on the pernicious myth that carbon sequestration through urban trees is better than building infill housing. 

Let's do the math!

A mature urban tree can absorb about 20 kg of CO2 per year. MIT Climate Issues rounded that to about 50 pounds. (Click through to read how they debunk some of the 'nature-based solutions' talking points.)

The EPA, US Environmental Protection Agency, reports that the Greenhouse Gas Emissions from a Typical Passenger Vehicle is 8,887 grams CO2/gallon or 404 grams CO2/mile using the US passenger car fleet average. 

The largest employers in my city are Northrop Grumman (next to a light rail station) and our local school district (dispersed around the city, not served well by transit).  Since school teachers cannot afford the median house price of $1,587,500 

or even the median condo price of $1,007,000

teachers drive in from elsewhere. The only places in LA County actively building new apartments and condos in substantial numbers is Downtown LA (DTLA) or Old Town Pasadena. 

If they want to buy an older single family home, like this one that sold yesterday in Whittier for $630,000, they also face a long commute. 

The Whittier house is 27-29 miles to Redondo Union High School depending on the route. Old Town Pasadena is 30 miles each way. 

A round-trip commute for just one of the hundreds of teachers in our city that cannot afford to live here is about 60 miles/school day. 

60 mi/day * 404 g/mi = 24,240 g/day = 24.24 kg/day

It would take a mature tree more than a year to sequester the carbon emissions of just one day's commute for a teacher commuting in from where they can find housing that they can afford.  

I looked up more data. 

California requires 180 school days/year. There are a few additional teacher prep and in-service education days, but let's use the lower 180 number. 

I looked up the RBUSD budget and see that there are 463.80 Full-Time Equivalent (FTE) teachers in the district. 

24.24 kg/day * 180 days * 463.8 teachers = 2,023,652 kg/year 

That would require 100,000 trees just for in-bound commuting teachers

That's just a few hundred of the 25,000+ jobs in Redondo Beach according to the research arm of Southern California Association of Governments (our regional housing and transportation governing body). 


I can't ensure that all infill homes will go to teachers in the community. 

I do know that teachers have to live somewhere, so they need homes. It would be great if they could live close enough to participate outside of school in the communities where they teach, and if they didn't need to drive a car to work.

The benefits of workforce housing:

  • Planet (fewer climate-wrecking CO2 emission)
  • Community (the teacher can be more present)
  • Public health (fewer car miles = less air/water pollution)
  • Teacher health (long driving commutes have well-documented detrimental health impacts)

Now substitute teacher for any other job in our city. This includes store clerks and caregivers to the elderly or young children that make just above minimum wage. They take care of us. We need to take care of them. We won't be able to build enough ADUs to fill the need. But, we can build enough apartments and condos, in a thoughtful way, to reduce the need for climate-destroying and space-gobbling automobiles. 

Asides: 

ADU = Accessory Dwelling Units or Granny Flats or In-Laws' units. ADUs generate a little extra density in single-family neighborhoods, create homes without generating much external impact. In fact, when used to house caregivers or those needing care, or local essential workers, they reduce car traffic or Vehicle Miles Traveled (VMT) overall.

Keeping low-density existing homes is NOT better than replacing them with higher density housing, even accounting for embodied carbon. But, I'll cover that myth in another post. 

I hear lots of chatter about preserving or increasing urban tree canopy in order to combat the urban heat island effect. That's a good idea. I'm all for trees. In fact, we bid aggressively on both our home purchases because they had more trees compared to other homes in our budget/area. More on that later. 

Redondo Beach has no native trees. It was a coastal prairie according to UCLA's Urban Wildlands Group (Dept of Geography). I'm stuck wondering what proponents are calling "Heritage Trees". 


Tuesday, September 20, 2016

Pushing back against Weapons of Math Destruction

I'm such a huge Cathy O'Neil fan, that I put Doing Data Science: Straight Talk from the Frontline on my very short list of recommended books for scientists and data scientists. I wrote:
The most hands-on of the meta books or the most meta of the hands-on books? Not many introductory books include a chapter on ethics but more should.
Weapons of Math Destruction is the book about data science ethics that I've been waiting for.


Listen to the interview with author Cathy O'Neil on All Things Considered.

I especially like this exchange:
MCEVERS: So it sounds like when you're saying, you know, we have these algorithms, but we don't know exactly what they are under the hood, there's this sense that they're inherently unbiased. But what you're saying is that there's all kinds of room for biases.

O'NEIL: Yeah, for example, like, if you imagine, you know, an engineering firm that decided to build a new hiring process for engineers and they say, OK, it's based on historical data that we have on what engineers we've hired in the past and how they've done and whether they've been successful, then you might imagine that the algorithm would exclude women, for example. And the algorithm might do the right thing by excluding women if it's only told just to do what we have done historically. The problem is that when people trust things blindly and when they just apply them blindly, they don't think about cause and effect.

They don't say, oh, I wonder why this algorithm is excluding women, which would go back to the question of, I wonder why women haven't been successful at our firm before? So in some sense, it's really not the algorithm's fault at all. It's, in a large way, the way we apply algorithms and the way we trust them that is the problem.
I hope you read or listen to the interview. Perhaps we can do a virtual book club and read it together?

In case you were not a reader of this blog in 2008, I wrote about my experiences using a proto credit-scoring algorithm while in high school student working part-time for Citicorp in the mid-1980s.  I did (with my boss' support) what I could to push back against arbitrary scoring algorithms when I felt they did not accurately capture an applicant's credit-worthiness.  It's also a time capsule for a time when we could assume that health insurance companies would eventually pay so that healthcare liabilities did not count against employed people.

What I didn't write in 2008 and should have, was that I applied to both Kelly and Kelly Technical Services. Kelly sent me to do the lower-skilled clerical work for slightly above minimum wage. Kelly Technical Services sent a male former classmate (who needed my help to debug one of his homework assignments) to work on implementing the software algorithm that eventually replaced the clerks like me. He got paid more. A lot more.

Bias was not created by algorithms.  We built the algorithms in our own image.


Saturday, May 09, 2015

Mothers' Day Flashback: Lessons in Freeway Calculus

NOTE: I originally wrote this essay for James Fallows' blog in 2011 without compensation.  It was published here.  I retained the copyright and I think Mothers' Day is a particularly good time to repost this essay.

As an immigrant, I hate to see my chosen team (America) dissed by know-nothings. The views of the governor of Pennsylvania, after an Eagles-Vikings playoff game in Philadelphia was postponed because of snow:
We've become a nation of wusses. The Chinese are kicking our butt in everything," he added. "If this was in China do you think the Chinese would have called off the game? People would have been marching down to the stadium, they would have walked and they would have been doing calculus on the way down.
Gov. Ed Rendell clearly doesn't understand calculus. If he did, then he'd know that calculus was basically invented to describe motion. (He should have read Steven Strogatz's Change We Can Believe In.) Therefore, anyone in motion -- whether walking to the stadium or driving in a SUV with heated leather seats -- is doing calculus.

(Thanks to my favorite math website, Wolfram MathWorld, for the figures and theorem info.)

On a more serious note, I want the general public to understand that math is a huge subject encompassing much more than arithmetic. People shouldn't give up their math education too soon just because they don't like arithmetic. Many mathematicians are only so-so at arithmetic.

Truth be told, after I finished the introductory lower-division undergraduate math courses at UC Berkeley, I hardly ever worked with actual numbers. My math homework consisted mainly of Greek symbols and other abstract notation along with copious arguments in English describing the steps of the proofs. It usually ended with relief and a big Q.E.D. as I finally signed off on my homework and could go to sleep.

Math is also so broad that mathematicians do not understand all areas of math. It would be like expecting a historian to know about the history of everything. It can't be done, though it might be fun to try.

It would be more productive to think of math as both a liberal art and a science. Not only is math the language of science, giving us a framework for describing our physical world, but it is also a construct of the human mind. As such, lessons learned from math can help us understand the human condition, moving it into the realm of humanities.

A friend who had been an English literature major and I discussed how we thought a book was mainly about one thing, and then reread it years later and thought it was mainly about something else. Was our past judgment so wrong? Or had experience and circumstance changed our perceptions?

Much as I enjoyed Steven Strogatz on the Elements of Math, I hope that readers will go beyond that. I will use the meaning of calculus as an example.

When I first encountered calculus in high school, I mechanically went through the motions of "turning the crank" to learn the rules of differential and integral calculus. I thought that was what it was all about. Sure, there were pages and pages of material about limits in the textbooks, but they were just a prelude to the real stuff of finding the derivative (slope) or the integral (the area under a plot) of a function. So, if you had asked me back then, I would have agreed with Strogatz.

But then a boy that was a year ahead of me in math at Cal told me that he didn't understand calculus until he took math analysis and "proved" calculus. That freaked me out; was I so clueless and shallow that I misunderstood the whole point of calculus?

The panic intensified when I took the class he referred to: Math 104, aka "Real Analysis and Introductory Topology." Our class spent the entire semester on proofs, including six weeks to prove the compactness theorem. What did that have to do with calculus?

Looking back, I can laugh about it. I see now that calculus is such a broad topic, and touches so many aspects of our lives, that it can mean different things in different contexts.

All those weeks spent proving the limit of an infinite series exists and is unique? That tells us that there is a solution of the integral described by the series.

The other weeks spent proving that some limits are reached more quickly than others? The mystery was revealed when I took numerical analysis (solving math problems with computer algorithms). Those fast-approaching limits will converge before lunch. Slower ones may take overnight. The really slowly-converging limits might converge if you made a lucky guess at the initial condition, but will more likely go shooting off into infinity (actually the dreaded floating point overflow error). It's really embarrassing when that happens.

My last big calculus insight occurred while driving across the San Mateo-Hayward Bridge near San Francisco with my daughter. A friend had warned me not to speed on the bridge. She said that cameras photograph the license plates of cars as they enter and exit the bridge; you need not be seen by a cop to receive a speeding ticket by mail.

How can they prove someone was speeding from two photographs? With calculus, using the basic form of the mean-value theorem:
Let f(x) be differentiable on the open interval (a,b) and continuous on the closed interval [a,b]. Then there is at least one point c in (a,b) such that
f'(c)=(f(b)-f(a))/(b-a).
This is the formula for a derivative on an interval. If a and b are the times your car was photographed (at the entrance and exit of the bridge), and f(a) and f(b) are the locations where your car was photographed, then your average speed is f'(c).

The bridge, or rather the distance between the two camera locations) is a fixed length. If not enough time elapses between the two timestamped photos of your car, then your average speed exceeded the speed limit.

You can compute the average speed with simple algebra; you don't actually need calculus for that. A motorist can try to argue that s/he was not actually observed driving above the speed limit.

But, assuming the time clocks on both cameras were well synced, the mean value theorem says that, even without an observation at the critical time, the motorist must have exceeded the speed limit somewhere along the bridge. The basis of the state's case rests upon a foundation of calculus.

As my daughter and I discussed how this system of cameras might work (and why she should have told me she needed to make a pit stop before we got on the bridge), I had an epiphany.

There is a whole family of mean-value theorems. One in particular leapt to mind, the intermediate value theorem.
If f is continuous on a closed interval [a,b], and c is any number between f(a) and f(b) inclusive, then there is at least one number x in the closed interval such that f(x)=c.
This has major implications in integral calculus, but that is not why I am mentioning it.

I explained herehow I get performance reviews for both my market work (from my boss) and my family work (from my daughter, who claims to be my boss). When I am an ideal worker, putting in long hours at my market (paid) work, I am not at home doing my family work. The opposite is also true.


The term "work-life balance" implies that it is possible to maintain a steady-state ideal balance. In real life, one always gets more than the other, though which one gets more varies  over time. As I oscillate between whichever place demands more of my attention right this instant, I used to feel like I was always failing. But, now, I take solace in calculus.

The intermediate value theorem assures me that -- somewhere between those two positions -- I pass through the state of my ideal self.

Monday, January 19, 2015

The transitive property of empathy

I've been meaning to write about this ever since the murder of Trayvon Martin, but race is a painful subject and I put it off.  However, I feel compelled to write about this for MLK day.

Trayvon Martin was an American teenager who went out in the rain to buy a treat for his younger sibling.  While he was out, he was stalked and killed by a vigilante ("neighborhood watch volunteer").  His killer was acquitted of murder charges because he argued that he "feared for his life" when Trayvon tried to fend the killer off.
Trayvon in a hoodie
Look at the child in this photo. My heart goes out to his parents.

Someone asked me why I was so emotionally devastated by this and I had to explain the transitive property of empathy. She wasn't a math major so I am not sure she understood what I meant.

In math, the transitive property of equality states that, if A=B and B=C, then A=C.

A=B

starts about 25 years ago, when I was taking graduate classes in physics at the University of Colorado.  Applied mathematics and theoretical physics students take many of the same courses.  The difference is that math students try to extend or invent mathematics.  If their math has real-world applications, that is just incidental.

Physics students like me just use the mathematics they develop to help explain or predict physical phenomena.  If we extend the math, that is just incidental.

I had exactly one black classmate in my mathematical physics classes; R was an applied mathematics graduate student.  Our paths crossed in several of the more theoretical classes.  I might have been memorable because there were few females, particularly American ones, in those classes.

Another physics student invited me to a party at his house.  R was also a guest and we had a lengthy conversation for the first time.  We talked about our classwork and research, how we were adjusting to life in Boulder, etc.

The most memorable thing about our conversation is that R and I both were consumed with trying to understand "our equations", the set of equations describing the thing we were trying to understand.  We were working with different equations, describing different processes.  (Well, in his case, the math doesn't even have to describe anything physical.)

We bonded over the admission that we sometimes fall asleep while puzzling over our equations and dreamt about them.  We were two students, from different parts of the country, different genders, different races, but I knew in that instant that R was my tribe.

The tribe of people for whom math is a passion is not large (in my personal experience, YMMV).

You attack a member of my tribe, you attack me.

B=C

Another time, R told me about how a police car followed him as he walked from the bus stop to his home.  The cruiser left only after R used a key to unlock the front door.  (R rented the basement apartment in a house in a non-studenty part of Boulder.)

The police car crept behind him on subsequent nights.  The officers would slow down, recognize him, and then take off without following him all the way to his house.  The implication is that a black man is inherently suspicious.

I was pretty outraged by this type of police behavior.  R's civil rights were being violated!

R said that was just his life as a black man.

Trayvon was followed by not the police, but a vigilante masquerading as a neighborhood watch volunteer.

R had a similar experience.  R lived to relate his experience.  Trayvon did not.

Trayvon was just a child.  He was still learning how to cope with the George Zimmermans of this world--something that white children do not need to learn.

In closing

Trayvon's death, and Zimmerman's acquittal, is a self-inflicted wound for all Americans.  It's time to analyze what led to this tragedy and how to prevent future ones.

If you are interested in other human lessons that mathematics has taught me, read Lessons of Freeway Calculus.

Wednesday, October 01, 2014

High-country fall colors

Bad Dad and Iris flew out to Colorado to visit me for a long weekend during Rosh Hashanah.  Bad Dad went hiking on Thursday while I worked and Iris did her homework in a conference room near my office.  Friday, we drove up Boulder canyon and along Peak to Peak highway to Estes Park, stopping for a short hike at Wild Basin.
Near Estes Park, Colorado

Near Allenspark

Trailside between the Wild Basin Trailhead in RMNP towards Calypso Cascades.
Happy New Year.

I have to do a little bit of mommy blogging/bragging.  I heard that Iris' math teacher needed to miss a day of class.  He left detailed notes for the substitute teacher, but the sub didn't know math well enough to understand them.  Iris read the notes and taught the class how to graph piecewise functions and determine left and right limits.

I congratulated her on understanding continuity well enough to teach it, but she informed me that continuity had nothing to do with it.  Fellow math majors will know why that is funny.

Friday, March 14, 2014

Happy pi day 2014

But, I want to point out, Pi is (still) Wrong!

Vi Hart explains:


When sewing neckbands on t-shirts, I recommend using your preferred circle constant, the minimum circumference necessary to pull over your head, the stretchiness of your fabric, and the width of the neck band to determine the optimal circumference.

For thicker neck bands and smaller openings, the 90% of neckline rule will result in a neckband that is too loose.  Do you need a drawing or an you visualize it?

Suppose you want a neckband that is 1 cm (about 5/8") wide and your neck opening is about 43 cm/17" (7 cm radius).  Using the 90% rule, you'd cut the band to finish at 39 cm circumference.

But, wait!  The radius of your opening is not at the sewn edge; it's at the inside edge, which has a radius of 6 cm and a circumference of 38 cm.

Your 39 cm tube will be too wide and floppy!

On a larger, scooped neckline, say 55 cm circumference and 8.75 cm radius, the inside edge would be 48.7 cm or 7.75 cm.  That's awfully close to 8.75*0.9 = 7.875.

Anyway, the 90% rule does come from geometry, but it only works for a range of neck opening circumferences.

Other sewing gurus say 85% of opening.  They mean smaller openings.

When in doubt, it's best to go back to first principles and calculate what you need based upon:
  • the minimum circumference necessary to pull over your head
  • the stretchiness of your fabric
  • your neck opening measurement at seam line
  • your neck opening at the folded inside edge
Your neck band should be a tube with a circumference a bit smaller than the inside, folded edge. Yet, it should not be so small as to distort (gather in) the shirt neck opening. If you have trouble with distortion, then change to a lighter neckband fabric, or reduce the difference between the two circumferences by either cutting a larger neck opening or using a neckband that is less tall.

Read past pi-day entries.

Saturday, December 14, 2013

Planet Money Math


Please help me with my math because I don't understand why Colombian labor costs more than Bangladeshi labor. They say:
The Planet Money men's T-shirt was made in Bangladesh, by workers who make about $3 a day, with overtime. The Planet Money women's T-shirt was made in Colombia, by workers who make roughly $13 a day, without overtime.
Later, they say:
In Bangladesh, on one sewing line for our T-shirt, 32 people can make about 80 shirts per hour. One sewing line in Colombia has eight people and can make about 140 T-shirts per hour.
In another segment, they say that the Bangladeshi workers put in 6 10-hour days per week.  Assuming that Colombian workers put in 8 hours per day (they have time left over to run side businesses so they have probably work fewer hours in the factory):

Bangladesh labor cost per shirt:
= ($3 per person per day/10 hours per day) * (32 people/80 shirts per hour)
= $0.12 labor/shirt

Colombia labor cost per shirt:
= ($13 per person per day/8 hours per day) * (8 people/140 shirts per hour)
= $0.09 labor/shirt

(I'm sorry that the fractional formatting is such a mess, but Blogger doesn't accept the MathML extension and I can't figure out a way to inject MathJax into Blogger.)

Jockey also says that the Colombia factory turns jobs around more quickly, can make smaller lots (to minimize the amount Jockey has to mark down due to lack of demand), and shipping is $0.10 from Bangladesh and only $0.07 from Colombia.  This makes Colombia the winner at $0.16 vs $0.22.

So why does Jockey say that they can save 20-30% by producing in Bangladesh instead of Colombia?  What data am I missing?  Or is my math wrong?

BTW, both the Colombian factory workers and the African shirt recyclers say that Americans must be gigantic (fat) people based on the sizes of our t-shirts.  Hmmm.  I guess we are over-consuming more than t-shirts.

Followup:

The Planet Money published data is definitely incomplete.  They did report that the Bangladesh factory did a few more steps, but did not elaborate.  I'll just assume that Jockey did their math correctly with their proprietary $ numbers.  This story did illustrate for me how much this global supply chain depends on cheap and reliable shipping.  Add time and cost to shipping, and savings evaporate.

It truly is an industry on roller skates seeking an instantaneous local minimum in cost.   People are treated like the commodities they make.   Why does it have to be so?   Is there anything we can do to change this system?

Friday, August 30, 2013

This will take more than eyeballs

I hear and read much about the competition for eyeballs to view advertising.  Does anyone else feel icky about being reduced to body parts?

I'd like to suggest a couple of rewarding and ad-free ways to spend time on the internet.  However, these will take some cognitive work.

Firstly, don't let the name of the course, Writing in the Sciences, put you off.  This course will help you right more clearly and quickly about any subject.  You need to take this class.  Seriously.  The instructor, Kristin Sainani, is justly famous for her teaching and editing prowess.  Even if you don't have time to do the writing and peer editing exercises, enroll and listen to her lectures.



I felt it was time to brush up on calculus so I signed up for Calculus One.  It's structured very similarly to "self-paced calculus", which was offered at University of Colorado at Boulder (CU) when I was a graduate student there in the 1990s, and is just what I was looking for.  But, it may not work for someone who is learning calculus for the first time and completely on their own.



--------------- Let me digress a minute.-----------------

College department funding is often tied to the number of students majoring in their subject. Some departments also need to teach "service" classes to students in other majors. E.g. physics majors need to take math classes, chemistry students need to take math and physics classes, and biology students need to take math, physics and chemistry classes. Who pays for the service courses?

There is much interdepartmental fighting over resources, which are always too scarce for the number of students that need to be taught. That's how I ended up teaching three .different. classes one semester for $800/month and completely burned out on teaching.

Service classes are chronically underfunded and CU came up with a creative and cheap response for calculus. Self-paced students used the same textbook as the traditional calculus students and were expected to master the same material. However, they didn't attend traditional lectures because there weren't enough seats in the lecture hall.

Instead, they went to a math lab staffed with at least one teaching assistant (open days, evenings and weekends) and equipped with computers that offered up practice questions (and answers). Students could do as many or as few practice problems as they liked on their own (in the math lab or elsewhere), but they needed to come into the math lab to take unit quizzes. After a set number of units, they took a mid-term. If they passed that, they earned one unit of calculus credit.

One of my chemistry students told me that, since she was a returning student and had taken calculus decades ago, self-paced was perfect. She breezed through the class in the first 5 weeks of the semester, before her other classes got serious. Then, she could focus on 3 classes instead of 4 for the rest of the semester. Another student recovering from a head injury (car accident), took 1-2 units of calculus per semester until she finally finished the required 8 (or was it 10?) units.

Yet another student said that he worked intensively on self-paced calculus when the skiing was bad and then ignored it when the snow was good.  So he got ahead in the fall, fell behind in the winter, and caught up again in the spring.  All three styles/strategies were successful in that they learned and retained enough math to pass quantum mechanics (which I taught at the time).

Students are charged only for the number of units that they passed, taking the financial pressure off. In a traditional class, students are charged for all classes (after the final drop date), regardless of whether they pass or even complete the classes.

The TAs in the math lab proctored exams and tutored students face-to-face (F2F). I think that the F2F contact is vital for keeping students engaged when the going gets rough.  I haven't figured out a better way to discern which concepts students are having difficulty grasping besides working F2F one-on-one or in small groups.

In a MOOC, students can replay a lecture segment ad nauseum, but a F2F tutor can change tack and come from a different direction when they see one approach isn't working.  Or they can diagnose what foundational understanding is missing and send the student back to learn the prerequisite(s).  F2F time is expensive and necessarily needs to be rationed in a public university.  Self-paced math was a good way to do it.

--------------- End of digression and back to MOOCs.-----------------

I wish Calculus One was available when I was learning calculus.  The lecture segments are so good--clear, yet also (mathematically) rigorous.  They aim to demystify calculus for new initiates, yet lay the foundation for more formal math analysis later on.  It's a seriously great use of MOOCs.

My only hesitation is that one really needs a F2F teacher to explain the whys and wherefores when students get stuck.  If you have a friend or a tutor who can help you get unstuck, Calculus One is perfect. If you teach math, you may want to sign up and witness some seriously great teaching.

I previously wrote about calculus for the Atlantic Monthly's website:
Lessons in Freeway Calculus

Thursday, February 07, 2013

Retraction

I slept on it and decided that my bias slip was showing.  I wrote:
5 years of daily practice, summer camps to train for math competition, really?
That's crazy talk from me.  When it came to violin, I (begrudgingly) practiced 2 hours per day and improved accordingly.  When it came to sports, I willingly practiced 2-5 hours a day.  I went to volleyball camp.   I went to orchestra camp.  Why did I diss Mathcounts camp?

Mea culpa and please call me when you hear crazy talk from me again.

Tuesday, February 05, 2013

Mathcounts

Addendum:
I've changed my thinking about math training. See my retraction.

The Mathcounts season is over for Iris' school. Like last year, they placed highly, but not highly enough to advance to the state tournament. They were bested by a highly selective private school and a few teams from wealthy neighborhoods who took a much more serious attitude towards training (5 years of daily practice, summer camps to train for math competition, really?).  But, I am proud of how well our kids did in comparison to other teams that took a similar "Let's keep it fun and upbeat" attitude.

The kids received two T-shirts for participating and Iris and another teammate won gift cards for ice cream for placing in the top (whatever) percentile.  Afterwards, the entire team went out for ice cream to celebrate.

Shapeless event T-shirts tend to go unworn and unloved in Iris' closet.  I recut the Ts using Kwik Sew 3476, adding waist shaping, trimming the body (from tunic to long T) and sleeve (from full to 3/4) lengths.  I found some knits with metallic foil at SAS in colors that match.  Click the photos to see the fabrics in full metallic glory.

After the most recent growth spurt, this 12 year old is wearing a size 14 or Kwik Sew Children's XL.
I purchased Kwik Sew 3476 to make performance ski-underwear for our upcoming trip.  The polyester interlock pieces I found at SAS were perfect for the T-shirt.  But, they lacked the lycra 2-way stretch  required for the leggings.

I'm proud of the stripe-matching.  But the leggings are going off to Goodwill.  Perhaps a very skinny child will find them useful.
Don't worry, I made her 3 more pairs with lycra.  You'll see the picture of those shortly.

Sunday, January 06, 2013

Self-learner project: Friendship Paradox

Your friends have more friends than you.  It't not you, it's the friendship paradox.  Your friends are not random.  They are more likely than you to be social butterflies or they wouldn't have met you (or maintain ties with you).

One of the professors teaching MITx: 6.00x Introduction to Computer Science and Programming stated that his goal was for us (the students in the class) to learn enough to break down problems and write python programs to solve them.

In the introductory chapter of my PhD thesis, I wrote that one of the reasons for modeling is to help explain the results of physical experiments.  Sometimes, modern experiments (not to mention, nature!) are so complex, it can be hard to interpret the data.  Through modeling, we can break problems down into simpler components and then add effects in until we match the observed data.  Then we can explain what actually likely happened.

Anyway, I wrote a python program to clarify the friendship paradox because it also explains why I, with a BMI of 22.5, am often the fattest person in Pilates or spin class.  Steven Strogatz explained:
For example, imagine going to the gym. When you look around, does it seem that just about everybody there is in better shape than you are? Well, you’re probably right. But that’s inevitable and nothing to feel ashamed of. If you’re an average gym member, that’s exactly what you should expect to see, because the people sweating and grunting around you are not average. They’re the types who spend time at the gym, which is why you’re seeing them there in the first place. The couch potatoes are snoozing at home where you can’t count them. In other words, your sample of the gym’s membership is not representative. It’s biased toward gym rats.
So back to the friends problem.  I started by thinking about the shape of the distribution of the number of friends one might have.
  • The distribution should be self-similar; the shape of the distribution of the friends of friends should resemble the shape of distributions of friends of friends of friends.  
  • The distribution must be positive; you can't have less than 0 friends.
  • The distribution should have a long right tail
A gamma distribution of shape = 2-3 looks about right.
My intuition was not bad.  In 2003, Bronius Grigelionis wrote a paper about the self-similarity of the Euler Gamma Function.  Gamma distributions are useful in modeling computer networks--why not people networks?

I sorted people by number of friends, from hermits on the left to social butterflies on the right. The number of friends for each person is in blue.  The average number of friends of friends for each person is in red.  Note that, for the first 400 or so of the 500 people, their friends have more friends than they do.

I had a heck of a time assigning friends to the social butterflies in a computationally efficient manner.  If you sort people by numFriends (taken from the Gamma distribution) from hermits to butterflies, than go up the sequential list, assigning them more friends from those remaining until they reach numFriends and having those people friend them back, you will eventually reach a problem.

There are simply not enough people leftover to fill up the friend lists for those social butterflies.  In that case, I had them friend everyone to their right and then randomly select friends from those on the left that had not initially selected them.  I assumed that those on the left friended them back out of politeness, which added slightly to the total friend count.

The distribution of number of friends for a sample population of 500 people:
The initial number of friends taken from the Gamma distribution is shown in green.  The distribution of adjusted friend counts is shown in blue.

The commands to run the program:
numf = pickNumFriendsRecur(500, shape=3, scale=5 stretch=8)
flist = assignFriends(numf)
fof = howMany(flist)

The output:
max(numf) > nsubj:  501 500
trying reducing scale to:  4.9
avg numf after iteration:  115.732
Target average friends:  115.732
Adjusted average assigned friends:  121.724
Average friends of friends:  151.410319998

I encourage you (and your kids!) to view and download the sample code from pastebin and play around with it.

Tuesday, January 01, 2013

Free Range Kids 7

This is a follow up to Free Range Kids 6.  I did some searching in my memory archives and in search engines and found How children lost the right to roam in four generations.  Here's the money shot:

While there are many journal articles going back decades, I don't have access to them.  Perhaps a reader with university library access can read and summarize some of them?  Here are a couple of recent ones:

Sex Differences in Spatial Competence: the ability of young children to map ‘primed’ unfamiliar environments

Spatial Ability and Home-Range Size: Examining the Relationship in Western Men and Women

Thursday, November 22, 2012

Picky AND Sneaky

My daughter has come up with a new reason not to eat her veggies. She refused to eat tonight's green bean casserole because I did NOT arrange the beans in a vector field.  But I did recently knit a sweater that resembles one.



The video reminded me about my idea for a real-time crowd-sourced global gravitational field mapping app. What a great way to teach geophysics to kids!  Sadly, the accelerometers in iPads and iPods are not accurate or precise enough for that.

Back to the drawing board.  Or, tonight, pecan pie and coffee.  ;-)

Happy Thanksgiving, everyone.

Sunday, October 28, 2012

Binary Birthday

We survived the birthday party.  Erin made another beautiful cake, based on Iris' drawing.  Iris dressed up as the girl in the window, aka "bloody Mary".

She selected a gorgeous white satin from Fabrix during our last trip to SF.  I made the Lois Hinse Barcelona Dress pattern, but I'm not going to show the dress because I sewed the skirt and bodice 90 degrees off.  (Note to self; RTFD.  The skirt seams are at the CF/CB, and not at the sides.)  I figured this out after sewing and serging the seam allowance.  There wasn't enough time to unpick all that stitching, get ready for the party and turn in homework for 2 Coursera and 2 EdX classes and the final for another Coursera class.

Anyway, The dress bubbled badly at the CF and CB waist seam.  But Iris told me not to bother unpicking the seams when she was just going to cover the dress in red paint.  Good point.

We went minimal on the candles.  We were surprised that only Iris knew that the candles gave her age in binary.

The kids use computers from such an early age, and none of the others knew binary?!?  Bad Dad and I really liked alternate number systems in elementary school.  We learned base 2(for computing) and base 9 (for casting out nines) in elementary school!  What are they teaching in school these days?

Bad Dad and I also went to elementary school in California.  The difference is a change in educational philosophy and curriculum.  California used to teach advanced math concepts at an early age.  But, under the guise of competitiveness and raising standards, they are dumbing down the curriculum.  Enough said.  My blood pressure is going up as I type this and I need to relax and wind down from a tough week.

Next week, I have an informational interview, a volunteer day in the classroom, and 4 more problem sets.  If I have enough time, I still have white thread in the serger and two more white print projects for Iris in the hopper.  Perhaps, there will be a white blouse for me, too.

Have a safe, fun and happy Halloween.

Friday, August 31, 2012

The myth of the 100-year flood

Casual handling of statistics make me cranky.  So we take a break from job-seeking and a SQL tutorial for this public service announcement about the so-called 100-year flood.

WaPost's Five myths about Hurricane Katrina included this tidbit:
4. New Orleans’s levees are fixed and could withstand another Katrina.
After Katrina, Washington committed $14.5 billion to flood-protection improvements that are supposed to survive a 100-year storm — a term of art that refers to storms that have a 1 percent chance of striking in any given year.
Kudos to writer Jed Horne for using "term of art" to emphasize that the term has a specific actuarial and regulatory definition.

Unfortunately, most people are not so careful.

If an area has a 1% chance of flooding each year, it does NOT mean that it will flood once per century.

I fired up python in an OS X terminal, but you can use any calculator or programming language you like to replicate these results.

Assuming each year is independent of every other year, you have a 99% chance of NOT being flooded in any given year.  Over a 100 years,

>>> .99**100
0.3660323412732292
you have a 36.6% chance of escaping flooding.
You also have a 1 - 0.3660323412732292 = 63.4% chance of being flooded at least once per century.

Over 50 years,
>>> .99**50
0.60500606713753635
you have a 60.5% chance of escaping flooding.
Conversely, you have a 1 - 0.60500606713753635 = 39.5% chance of being flooded at least once.

Suppose you have a 2% chance of flooding each year.  Over 100 years, 
>>> .98**100
0.13261955589475294
you have only a 13.3% chance of escaping flooding.

Hey, that doesn't scale (linearly)!  ;-)

The power of powers never ceases to amaze.

You may also want to read What planet are they on? for another illustration of nonlinear phenomena.

Saturday, May 12, 2012

The standing ovation model


I seldom stand up after a performance (except to leave). But our entire family gave a standing ovation to Follies tonight.

Tuesday, March 13, 2012

Happy Half Tau Day

Even though I concur with Bob Palais that Pi is Wrong, I hope you have a good day tomorrow.

I am swamped at home and at work, and the tutorial on how to knit a circle in any stitch pattern will have to wait. Perhaps Tau day would be a good target deadline. After all, the method relies on the crucial fact that
circumference = τ*radius
which looks so much more elegant than
circumference = 2*π*radius

I never did like how it takes 2π radians to go one full rotation. The beauty of τ is that one τ is one rotation. How intuitively easy to remember! τ and π were both in historical usage but π had better PR and edged out the more elegant τ.

May I suggest you view Vi Hart's lighthearted take, Pi is (still Wrong)?



Math and physics aficionados should read Pi is Wrong and the Tau Manifesto. The first time I read Pi is Wrong, I smacked myself on the forehead. Doh, why didn't I think of it before? I am not to blame for those pesky factors of two; it's the stupid notation! Read section 3.1 Quadratic Forms of the Tau Manifesto and admire the elegance and consistency.

Aside:
I took Numerical Analysis with Bob Palais while he was teaching at UC Berkeley. It was a really fun class and I never forgot the lessons he taught me. I remember the day he explained higher order Runge-Kutta schemes and their numerical stability looked to be the best thing since sliced bread. Then he broke out in a rendition of The Rolling Stones' You can't always get what you want.

Unfortunately, there is always a catch. Numerical stability and accuracy is gained at the cost of computational speed and memory usage.

When I needed to implement Runge-Kutta integration of Hamiltonian systems for my PhD research, I found myself humming the Rolling Stones. I found the right trade-off balance so that my molecular dynamics simulations converged quickly and accurately enough to allow me to graduate. Thanks, Bob. ;-)

Saturday, February 18, 2012

The geometry of basketball

In the 1990s, I heard an early version of Jim Faller's "The Physics of Basketball" talk. I wish he would post a version of the talk on the web because it really changed the way I see ball sports.

Q: When does a basketball go through the hoop?
A: When the ball is smaller than the hoop.

That can sound nonsensical. A NBA regulation ball is about 9" in diameter and the hoop is 18" in diameter. If the ball is always smaller than the hoop, why doesn't it go in every time?

The hoop does NOT appear circular to the ball as it travels through the hoop.

I drew the schematic for a ball passing through a hoop perpendicular to the plane of the hoop, 90°; and 60°, 45°, 30°, 15° to illustrate.

The ball is easily smaller than the hoop when directed straight downward--like when slam dunking. But, if you are shooting a basket from the court, the size of the hoop depends on the angle of approach of the ball. At around 30°, the ball and the rim are roughly the same size.

This simplification ignores spin, velocity, the backboard and the energy dissipation capacity of the rim. That's why I titled this post, "the geometry of basketball" instead of "the physics of basketball".

But, as soon as Jim mentioned the size thing, I saw a picture of the rim as a separatrix between the scoring and non-scoring regions in my mind. And then I understood the importance of standardizing the materials and flex of the rims and the backboard, and why a player should shoot from as high a vantage point as they can (and still do it accurately).

Then I lost track of the next 10 minutes of the talk as I started applying this to volleyball approaches. My HS volleyball coach was soooo right about approaching from outside the court. Leave a comment if you want me to draw diagrams of how your VB spiking approach determines your collisional cross-section with the set.

Aside:
This post was motivated by Lin-mania. As I mentioned here:
In high school, I worked harder and longer on competitive sports than academics. This was a poor use of my time as Caltech was the only school interested in me athletically. However, I doubted their sincerity; I thought they were secretly interested in my math skills. I ended up at a division I school where the coaches told me not to even bother trying out.
I'm a big believer in practice. Yes, some people are more intrinsically gifted than others. But, all people can improve with practice. For the most part, school wasn't challenging for me until college (with the exception of a few HS classes). So I found something that was hard for me, sports, and worked very, very hard at it until I became good.

Over time, people started calling me a "natural" athlete. Nothing could be further from the truth. It took practice, good coaching, and development of awareness.

I don't think it had anything to do with my Taiwanese-American heritage, or the Japanese and African-American ethnicities of my coaches. They both taught me the importance of drills, conditioning and analyzing the game to see what was effective and what was not. Those were good lessons when the schoolwork became tougher.

Tuesday, May 17, 2011

It gets better, the gifted version

Bad Dad and I were wondering if it is time for a It Gets Better campaign for gifted kids.

I was talking with a reporter about my finding that super-high-test score districts are less likely than average to advance their kids in math. He wondered how I stumbled upon that finding. Why had I bothered to look at the data in that way?

The short answer is that it is because I care. But I care for a reason that was not immediately obvious to him. I better spell it out really clearly.

It's not about bragging rights about whose child is more advanced.

It's about the child who is sitting in math class, thinking she just might not be cut out for math because she will tear her hair out if she has to sit through another fracking demonstration of long division.

It's about the child who gets sent to the principal's office for reading a book in math class (and being told to go back to the classroom to apologize).

It's about the child who quickly turns over her 100% test grade so that the other kids don't see it--lest she get beat up in the school yard over that.

It's about the child that got beaten up in the school yard anyway, while the other kids watched, and then took turns kicking her once she was pulled down to the ground.

It's about the kid who looked to the teacher across the school yard for a rescue, and watched the teacher walk away instead.

It's about me.

I'm here today to tell you that, if they ever let you go beyond long division and fractions, it gets better.

You'll learn that rational numbers are a field under addition, negation and multiplication but integers are not. Integers are merely a ring because they lack the inverse under multiplication. And every system of algebra opens up a different universe of possibilities.

And the special algebra of infinite-dimensional Hilbert spaces will open up the world of quantum mechanics to you. And, once you gain entree into that world, you will see how the quantum world manifests itself in the macro world all around you.

Who knows? You might even learn about general relativity and make relativistic corrections for satellite-to-satellite communications.

You might even work at a place alongside 850 other PhD-holding rocket scientists, marry one of them, raise a family and take fantastic trips (with the MIT alumni travel program).