Linear algebra applications

I spent the last month at the chalet in Petkovo, the village where my grandfather is from. Check out the view from my office:

View from the office in Petkovo

I have good progress to report on the linear algebra book. Sandy (my editor) has gone through the first few chapters and looks on track to finish editing the book by the end of October, which means the NO BS guide to LA will be available in print soon.

On my side, I’ve been working on the applications chapter. In this chapter I discuss all the cool things you can do using linear algebra. The topics covered include linear programming, error correcting codes, solving for the voltages in electric circuits, and other applications to economics and science. It really feels good to be able to discuss all these applications, and substantiate the claim I make in the book’s introduction, namely, that learning linear algebra will open many doors for the reader.

In other news, I think I’ve finally found a civilized way to generate html and .epub versions of the book: polytexnic, which is part of the softcover platform for self-publishers. Here’s a quote from the documentation:

The real challenge is producing EPUB and MOBI output. The trick is to (1) create a self-contained HTML page with embedded math, (2) include the amazing MathJax JavaScript library, configured to render math as SVG images, (3) hit the page with the headless PhantomJS browser to force MathJax to render the math (including any equation numbers) as SVGs, (4) extract self-contained SVGs from the rendered pages, and (5) use Inkscape to convert the SVGs to PNGs for inclusion in EPUB and MOBI books. Easy, right? In fact, no—it was excruciating and required excessive amounts of profanity to achieve. But it’s done, so ha.

Stay tuned for .epub version of the books in the No BS guide series.

Math makes you cry? Try SymPy!

This summer I wrote a short SymPy tutorial that illustrates how a computer
algebra system can help you understand math and physics. Using SymPy you can solve all kinds of math problems, painlessly.
Check it:



Sympy tutorial (PDF, 12 pages)

Print this out, and try the examples using live.sympy.org. The topics covered are: high school math, calculus, mechanics, and linear algebra.

SymPy makes all math and physics calculation easy to handle, it can even make them fun! Learn the commands and you’ll do well on all your homework problems. Best of all, sympy is free and open source software so your learning and your calculations won’t cost you a dime!

Comments and feedback below, on HN, on fb, or via twitter.

Stickers

My friend and former student David Ancor came up with this ingenious strategy for promoting his startup (makeachamp.com): post promotional stickers on lamp posts in public places.

I like this because it is a fairly un-advertised space so people haven’t gotten used to it. In particular, I like the fact that I can place the stickers specifically near the McGill residences to target specifically first-year students. I’ve previously wrote this about the main challenge faced by Minireference Co. right now—reaching my target audience of freshman students.

So here is what I’ll be posting:



I decided not to go for a bit.ly URL because I think showing the full domain is cleaner. It would be nicer to “test” the effectiveness of this strategy, and A/B test different designs, but I find showing the real destination is a respectable towards people.

Also, if you have any ideas about what I should use as the pitch. If you’re a freshman or a freshwoman, what would line of text would convince you to check out this book?

Marketing problem

I have a marketing problem. My company’s product is perfect for an audience of university students (a math textbook that explains concepts clearly, concisely, and affordably), but students can’t recognize the value of the product.

My current readers are of a different audience: the adult technical crowd. These readers have often already taken calculus and mechanics courses in their university days, and can instantly recognize that all the material they learned in class is covered in the book. They’re not alarmed by the short format—in fact they like it because they wouldn’t have the time to go through a mainstream textbook.

The problem

How can we convince first-year university students to buy the book instead of the calculus and mechanics textbooks chosen by their professors?

The trust problem. Who the hell am-I to be teaching these advanced subjects? Isn’t the mainstream textbook written by a professor guaranteed to be better. Professors often have full-hair loss and I have only partial hair-loss so surely professors are much smarter than me?

In all humbleness, I can say that most of my explanations are better than the ones in mainstream textbooks because (1) I’ve experimentally tested each of them with students during 13+ years of private tutoring, (2) the fact that I’m not old is actually a feature—the conversational coverage of the material leads to better engagement.

While good, these points are difficult to get across in marketing copy. Too much explanation is required, tutoring experience, alternate explanations, trial-and-error, explaining of connections between topics, etc. Also I can’t tell you the tone of the writing is different (less formal, more chill), you must see it for yourself.


Already bought the book aspect. Placing myself in the student’s shoes, I will feel like an idiot if I accept that a \$30 book can teach me everything I need to know about mechanics and calculus, but I already bought \$300-worth of textbooks. Since I don’t like to think I’m an idiot, I prefer not to believe the short book is of sufficient quality.


The study guide image problem. By its small size (5.5″x8.5″x400pp) the book resembles study guides like Shaum’s outlines and Cliff’s notes. These are not complete books, but short guides with summaries that complement a regular textbook.


Exam prep book image problem. The “learn quickly, pass the exam” rhetoric in my marketing message is usually associated with exam-prep books, like those for the SAT and GMAT. Instead of complete books focussed on understanding, these books focus on practice problems and rote learning for speed. They are the anti-thesis of what I’m trying to do. How can I convey to my potential readers that I’m not out to exam-prep them, but to teach them to understand the concepts for real. The ability to pass exams with flying colours is just a useful side effect of understanding the material well.

I must find a solution by the end of this summer so I can make a killing when school starts in September. My runway is running out. Do or die—sell or perish, that’s Darwin’s law of natural selection for startups.

Call for proposals

If you can help me solve this problem this summer (2014), I’ll be very grateful, so grateful that I’d be willing to setup a profit-sharing scheme for the sales of Sept-Dec 2014. Get in touch if you think you can help me.

Linear algebra concept maps

I spent the last week drawing. More specifically, drawing in concept space. Drawing concept maps for the linear algebra book.

Without going into too much details, the context is that the old concept map was too overloaded with information, so I decided to redo it. I had to split the concept map on three pages, because there’s a lot of stuff to cover. Check it out.

Math basics and how they relate to geometric and computational aspects of linear algebra

The skills from high school math you need to “import” to your study of linear algebra are geometry, functions, and the tricks for solving systems of equations (e.g. the values $x$ and $y$ that simultaneously satisfy the equations $x+y=3$ and $3x+y=5$ are $x=1$ and $y=2$.)

The first thing you’ll learn in linear algebra is the Gauss–Jordan elimination procedure, which is a systematic approach for solving systems of $n$ equations with $n$ unknowns. You’ll also learn how to compute matrix products, matrix determinants, and matrix inverses. This is all part of Chapter 3 in the book.

In Chapter 4, we’ll learn about vector spaces and subspaces. Specifically, we’ll discuss points in $\mathbb{R}^3$, lines in $\mathbb{R}^3$, planes in $\mathbb{R}^3$, and $\mathbb{R}^3$ itself. The basic computational skills you picked up in Chapter 3 can be used to solve interesting geometric problems in vectors spaces with any number of dimensions $\mathbb{R}^n$.

Linear transformations and theoretical topics

The concept of a linear transformation $T:\mathbb{R}^n \to \mathbb{R}^m$ is the extension of the idea of a function of a real variable $f:\mathbb{R} \to \mathbb{R}$. Linear transformations are linear functions that take $n$-vectors as inputs and produce $m$-vectors as outputs.

Understanding linear transformations is synonymous with understanding linear algebra. There are many properties of a linear transformation that we might want to study. The practical side of linear transformations is their nature as a vector-upgrade to your existing skill set of modelling the world with functions. You’ll also learn how to study, categorize, and understand linear transformations using new theoretical tools like eigenvalues and eigenvectors.

Matrices and applications

Another fundamental idea in linear algebra is the equivalence between linear transformations $T:\mathbb{R}^n \to \mathbb{R}^m$ and matrices $M \in \mathbb{R}^{m\times n}$. Specifically, the abstract idea of a linear transformation $T:\mathbb{R}^n \to \mathbb{R}^m$, when we fix a particular choice of basis $B_i$ for the input space and $B_o$ for the output space of $T$, can be represented as a matrix of coefficients $_{B_o}[M_T]_{B_i} \in \mathbb{R}^{m\times n}$. The precise mathematical term for this equivalence is isomorphism. The isomorphism between linear transformations and their matrix representations means we can characterize the properties of a linear transformation by analyzing its matrix representation.

Chapter 7 in the book contains a collection of short “applications essays” that describe how linear algebra is applied to various domains of science and business. Chapter 8 is a mini-intro to probability theory and Chapter 9 is an intro course on quantum mechanics. All the applications are completely optional, but I guarantee you’ll enjoy reading them. The power of linear algebra made manifest.

 


 

If you’re a seasoned blog reader, and you just finished reading this post, I know what you’re feeling… a moment of anxiety goes over you—is a popup asking you to sign up going to show up from somewhere, is there going to be a call to action of some sort?

Nope.

Filing taxes for self-employed business income in Québec

When you run your own business as a sole proprietorship, you must fill in two special tax forms when submitting you income tax return. The Canada Revenue Agency’s form T2125 and Revenu Qubebec’s form tp-80.

The best place to start are the excellent PDF guides offered by the CRA and Revenu Québec: Canada GuideQuebec Guide.

Gross income = Sales – Cost of goods sold

Where cost of goods includes: Opening inventory (raw materials, goods in process, finished goods),  Net purchases (not including the cost of merchandise for personal use), Subcontracting costs, Direct labour costs, and Other costs.

Next, you can add up all the Expenses relating to your business activities:

  • Advertising 
  • Meal and entertainment expenses (1.25%-2% of sales). 
  • Bad debts 
  • Insurance premiums 
  • Interest 
  • Business taxes and licences 
  • Office expenses. (Not including home-office expenses below)
  • Supplies
  • Legal fees
  • Management and administration fees 
  • Rent 
  • Maintenance and repairs 
  • Salaries or wages, benefits and employer contributions. 
  • Property taxes
  • Travel expenses, other than motor-vehicle expenses 
  • Telephone, electricity, heating and water 
  • Fuel and oil 
  • Delivery, freight and messenger services 
  • Motor-vehicle expenses, excluding capital cost allowance. 
  • Deduction respecting incorporeal capital property 
  • Capital cost allowance. 
  • Terminal loss.
  • Other expenses

Additionally, if you work from home, you can claim Home office expenses:

  • Heating
  • Electricity
  • Insurance
  • Maintenance costs
  • Mortgage interest
  • Property taxes
  • Other expenses (e.g. rent)

You’re allowed to claim some percentage $r, 0 \leq r < 1$ of all these amounts proportional ratio of your home that you use for business purpose. Usually $r=0.5$, but it could be more or less depending on how many rooms you use and whether you meet with customers at home.

Dwarslezer

I’m visiting Amsterdam and I saw this young lady on the ferry who was reading a small book. The young lady was stunningly beautiful but ferries being public transport and all I wasn’t about to chat her up. The tiny book continued to intrigue me though, so I mustered the courage to go talk to her. “This is about the business after all—not a pick up line,” I said to myself.


She turned out to be the nicest girl ever and explained to me this book format is called DWARSLEZER, which roughly translates to cross-reader. She even wrote it down for me—because let’s face it, Dutch is a pretty incomprehensible language for anyone non-Dutch.

It seems the first publisher to use this format is Jongbloed who called it the “dwarsligger” meaning “cross-beam” or “cross-bar”. Other publishers (AW Bruna Uitgevers, Dutch Media en Nieuw Amsterdam) have released books in this format and there might  be some legal action going on.

This format is a great idea because it halves the overall size of “the object you carry” or equivalently we can say it doubles the size of the page you read. Also the book she was reading was 500pp-long but no thicker than 1.5cm, so the “bible paper” helps to make the format compact.

Watch out for a dwarslezer edition of the No bullshit guide to math and physics coming soon!

The economics of writing books people want

I just saw this article on priceonomics about profits from books(via HN). It hits some facts right on the nail, gets others wrong, and finally misses the main point. Let me quote here the best parts (with comments) and give you my interpretation of what print-on-demand and ebooks will bring about.


With publishing houses only offering a royalty rate of between 6-15%.

Let’s say more like 2%–5% because this is from the *profits*, not a percentage of the sale price.


Email marketing was critical.

You got that right!


Self-publishing is arguably a wonderful innovation. It is historically unprecedented, providing the means for millions of people around the world to bypass the elitism of the publishing establishment […] In terms of access to a worldwide marketplace, it is fantastically democratic. In terms of access to financial success, it is far from it.

The OP misunderestimates the power of a democratic marketplace. There is a process of natural selection for book products. It used to act on a time scale of years and decades in the old days, but with the ease that information spreads now, I predict increased competition on the marketplace and unprecedented advances in book quality. As authors start to earn money from writing books, better books will be written. Also, the higher margins of self-publishing (think 50%) make solo authors and mini-publishers much more competitive that the old dinosaurs.

It is my hope that if books become better, more youth will escape their brain being crushed like a jujube by fast-moving pixels activities and learn to think bigger thoughts—hopefully constructive ones. Could an increase in interest in books bring about a new golden age of reason?

That would definitely be nice; enough with the consumerism, warring, and financial schemes. Let’s have another renaissance or something…

Problem sets ready

Sometime in mid-December I set out to create problem sets for the book. My friend Nizar Kezzo offered to help me write the exercises for Chapter 2 and Chapter 4 and I made a plan to modernize the calculus questions a bit and quickly write a few more questions and be done in a couple of weeks.

That was four months ago! Clearly, I was optimistic (read unrealistic) about my productivity. Nizar did his part right on schedule, but it took me forever to write nice questions for the other chapters and to proofread everything. After all, if the book is no bullshit, the problem sets must also be no bullshit. I’m quite happy with the results!

noBS problem sets: letter format or 2up format.

Please, if you find any typos or mistakes in the problem sets, drop me a line so I can fix them before v4.1 goes to print.

Tools

In addition to work on the problem sets, I also made some updates to the main text. I also developed some scripts to use in combination with latexdiff to filter only pages with changes. This automation saved me a lot of time as I didn’t have to page through 400pp of text, but only see the subset of the pages that had changes in them.

If you would like to see the changes made to the book from v4.0 to v4.1 beta, check out noBSdiff_v4.0_v4.1beta.pdf.

Future

Today I handed over the problems to my editor and once she has taken a look at them, I’ll merge the problems into the book and release v4.1. The coming months will be focussed on the business side. I know I keep saying that, but now I think the book is solid and complete so I will be much more confident when dealing with distributors and bookstores. Let’s scale this!