Linear algebra v2 beta release

The No bullshit guide to linear algebra files on gumroad were updated. The book is now v2 beta 2, and scheduled for release in early January 2017.

If you’re taking a linear algebra class this term, or need to know linear algebra for a more advanced class, this will be the best money you spend this semester.

 

Why?

Math is power. Specifically, the ability to use math models to describe real-world phenomenon and predict the future is a powerful general tool to add to you toolbox. Linear algebra has applications to many fields. In general, understanding basic math, and specifically functions of the form \(f(x)=y\) like \(x,x^2,x^3,x^n,e^x,\ln(x),\sin(x),\cos(x),\tan(x),\ldots\) opens many doors for mathematical modelling.

Linear algebra is the study of linear transformations, or vector functions of the form \(T(\vec{v}) = \vec{w}\). The linear transformations take vectors \(\vec{v}\) as inputs and produce vectors \(\vec{w}\) as outputs.  Many real-world phenomena in computer science, physics, chemistry, biology, and many other fields can be modeled as vector quantities, so linear algebra has countless applications. Linear algebra is the vector extension to your math modelling toolbox.

 

How?

Everyone knows that math is useful, but people much rather leave the learning of math to other people, rather than learn math themselves. Most people imagine learning math is a difficult task, like carrying big bags of potatoes up a steep hill. Surely, such hard work is not for everyone, and we should delegate all the potato-carrying to experts in the field (mathematicians, scientists, and engineers). This way of thinking gave us a modern world where only a small portion of the world is math literate. Everyone else lives in ignorance and fear of all things mathematical.

It doesn’t need to be this way. Everyone can learn math—even advanced math like linear algebra—if they follow a structured approach. Each section in the No bullshit guide to linear algebra follows the same recipe:

  • Motivation to trick readers into wanting to learn about the topic
  • Definitions of all quantities and variables relevant to the topic
  • Formulas: all the essential formulas associated with the topic are given
  • Examples that show how to use the formulas in different scenarios
  • Explanations about how the formulas are derived and how to understand them
  • Discussion about how the connections between this topic and other
  • Exercises to test your understanding of the concept
  • Links to web resources for further reading

This structure allows to get all the important information across in the shortest amount of time. The reader is free to skim through superficially, or dig in an read all the explanations. The exercises help both students and self-learners test there understanding of the material.

 

What?

The No bullshit guide to linear algebra is a short textbook that covers all the standard topics of university-level linear algebra, and also discusses applications like machine learning, computer graphics, probability theory, and quantum mechanics.

You can buy the eBook bundle here ($29, includes all future updates). The book is currently being edited, so it’s likely to see some further improvements to the chapters on applications, but the main material (that which will be on a an exam) is absolutely solid now.

@Students: get in touch with me if you’d like to be a “test subject” for the new  problem sets. I wrote 50+ pages of new problems and solutions for the book, and I could use your help to double-check the answers.

No BS math and physics v5.1 update

Over the last years, several readers uncovered mistakes in the No bullshit guide to math & physics, which I immediately fixed in the source. The errors were mostly minor, so they didn’t warrant a new edition, but once I reached a threshold of six errata, I decided it’s time to release a v5.1 update. With this bugfix update, I took the time to make some other minor improvements described below.

Errata

Most of the mistakes in v5 of the book were in the exercises and problems. I’m happy to announce there are no major conceptual problems, or mistakes in any of the core equations. Here are the mistakes in v5.0 (Aug 2014) of the book:

  • P1.41: Both calculations should use the radius instead of the diameter. The change in height is $h_2 – h_1 = 5.47 – 4.41 = 1.06$ cm.
  • P1.44: Answer should be 8.42m = $4\sin 40 + \frac{1}{4}(2\pi(0.5)) + 4\cos 40 + 2$.
  • P1.47: Answer should be 180 degrees – 40 degrees = 140 degrees.
  • P1.51: Question describes the water tank as $12 \times 6 \times 3$, but solution uses $12 \times 6 \times 5$. The question was changed to match the existing solution: the tank now has height $5$[m].
  • P2.9 part (3) $v_f$ should be 6 [m/s], not 10 [m/s].
  • P2.10, part 4. Distance should be 13[m] not 14[m].
  • page 202: Revolution of the Earth example: $v_t$ should be 328.32 m/s not 464.32 m/s, giving a final answer of 1181.95km/h not 1671.56 km/h.
  • 5.5 Limit formulas, page 264 at the bottom: removed formulas $\lim_{x\rightarrow0}\frac{\ln(x+a)}{x}=a$ and $\lim_{x\rightarrow0}\left(a^{1/x}-1\right)=\ln(a)$. First formula is wrong, second is not useful.
  • page 286: “Consider the point $P=(x_P,y_P)$ that lies on the circle $x^2+y^2=R$.” should be “Consider the point $P=(x_P,y_P)$ that lies on the circle $x^2+y^2=R^2$.”
  • page 401: the correct conversion formula for inch is 1[in] = 2.54[cm] and not 1[T] = 1000[kg].

 

New math exercises

Several readers complained about the math fundamentals chapter being too “rough” for complete beginners. To fix this, I did a critical rereading of the material and corrected some mistakes of continuity (there was crazy rough patch in Section 1.2 where I suddenly jump into negative and fractional exponents that—not surprisingly—some readers found confusing). I also interspersed exercises throughout Chapter 1 so readers can now test their understanding as they progress through the chapter.

 

Index

Thanks to the suggestion in a comment on amazon, I decided it the book should have an index. It turned out creating an index was a very time-consuming task, but it was very totally worth it since it allowed me to standardize certain terminology (e.g. function range vs function image) and weed out certain inconsistencies.  The exercise of cataloguing every concept used in the book will help with STRUCTURE project too.

 

New proof of the chain rule for derivatives

A mathematician friend of mine pointed out a mistake in the proof of the chain rule for derivatives in the book. The hand-wavy argument that I had improvised had possible divide by zero error: the quantity $\Delta = g(x+\delta) – g(x)$ can be zero, so it’s not OK to use it in expressions where it appears in the denominator. In other words, bullshit had creeped into the book!  We can’t have any of that in a book which claims to be bullshit free! The new proof of the chain rule for derivatives is longer and more technical, but at least it’s not wrong. Hopefully I will not alienate my readers too much by having such a technical argument in the middle of the calculus chapter, but there really wasn’t any way to make the proof simpler or more intuitive. It’s just a technical argument.

 

More calculus problems

Upon critical review, I found the section on surface and volumes of revolution was a little short. Sure all the formulas are introduced, but it would have been a stretch to assume the average reader will be able to pick up the concepts from these few pages. To remedy this, I added a few more pictures, beefed up the discussion, and added some problems. I also came up with a “append only” policy for adding problems to the book—this way the numbers won’t change between versions so if  a prof assigns P5.33 to their students, it will be the same problem in v5, v6, or whenever. The new problems added test the student’s ability to apply the volume of revolution formulas and also the infinite Riemann sum formula.

 

The diff

As with previous updates, I’ve generated a red-blue diff of all the changes between v5.0 (Aug 2014) and v5.1 (July 2016). You can check out the diff to see the details of all that changed.

 

Right now I’m waiting for the green light from my editor about the changes and the next step will be to push the updated PDFs to all distribution channels. I’ll also send out an update email to all readers.

No bullshit guide to programming

How does one learn to code? Students in computer science and software engineering will have a few first-year programming courses, with the first one introducing basics like variables, control flow, and loops. Autodidact programmers probably started with a tutorial somewhere, but eventually got a book on the subject. Regardless of the learner’s path, we’re talking about a book that teaches “the basics.”

This is the table of contents I have in mind:

  1. Fundamentals
    1. math review (numbers, variables, functions, multi-step procedures)
    2. syntax and new type of objects (variables, functions, algorithms, int, float, list, dictionary, objects)
  2. Programming basics
    1. Expressions
    2. Functions
    3. Control flow
      1. If elif else
      2. Loops
  3. Structure of programs
    1. modules
    2. libraries
    3. frameworks
  4. Algorithms
    1. Binary search algorithm
    2. Sorting algorithms
    3. Graph algorithms
    4. Numeric algorithms
    5. Optimization algorithms
  5. Applications
    1. Fancy scientific calculations made easy (SymPy, numpy)
    2. Automate info. processing tasks (bash scripting)
    3. Generating reporting and useful analytics from data (pandas)
    4. Creating websites (Django)

It’s not the standard set of topics for the “COMP101 textbook” category,  but I bet with some thought put into it, it can be made to contain most of the material for a first-year coding class. We just godda make sure that profs will have enough to support teaching their class. Best of all it could all probably fit in 300 pages, and retail under $40. It could be even thinner, but would be better to have lots of exercises.

I’m thinking about this today because I was visiting McGill and had the chance to talk with the prof who taught my first-year programming course and we somehow got to the topic of textbooks. She remembered the computer science textbook she learned from, and described it as being very thin. So it can definitely be done.

The book described above doesn’t exist yet, but if you leave comments below telling me you want it, it will move up in the priority list…

Annual general update

It’s May. Winter is done now, so it’s time for spring cleaning! In addition to cleaning your living space, Spring is also a good time to clean out the “project plans” and focus on one or two key goals for the summer. This is what I intend to do in this post. Read on to learn about the recent developments, and the strategic plan for Minireference Co. for the coming year.

Since the LA book is finished, I will have more time now to focus on software projects and push forward all aspects of the business. Being in content-sprint-mode on LA applications for the past year really didn’t leave much time for updating the website, communicating with readers, twitter outreach, and developing sales and marketing channels in general. It’s like the business side of the company is asleep for one year.

Business is going strong, but to grow to 10x current size we’ll need a good strategy. It’s time to extend the product line to Web, Mobile, ePub, and Kindle. It’s also time to develop new products like email courses, exercises, jupyter notebooks, youtube tutorials, and maybe even audio lessons. A younger version of me would try to do all of these at the same time, but now I know that technology for the sake of technology is an empty pursuit. (That being said, sometimes quick wins can be had using the right tech, so any project that can ship in less than a week is OK.)

I need to think strategically, and also not think too much and focus on shipping.

The big picture

Let’s first figure out the overall mission. What do you want your readers to become? I want all my adult readers to become awesome at math. Also, I want all the analytically minded youth to be aware of the System. I want everyone to have affordable access to university-level science knowledge. Okay, so how do we do this?

Content

Writing books is a lot of work, but there is no way to avoid this. If I want to ensure a consistent high quality of explanations and the logical coherence of the lessons, I have to be involved with all the books. I don’t need to be the main author though—I can be the developmental editor. I think this is my true calling in life.

Each book takes about two year to produce, so as long as it’s just me writing, Minireference Co. will always be on the flat part of the hockey stick growth graph. The best thing for growth right now is to find qualified authors that can help me scale to 10x current number of books in two years. Somewhere out there there is a chemist with years of tutoring experience who can write the No bullshit guide to chemistry in no time at all. Somewhere out there there is an economics grad student who can explain all the ideas from macro and micro economics in a single 200pp book. Same for differential equations (can be written either by a math student or an engineer, or a collaboration?). I definitely need a stats book too, written by a real statistician.

Content TODOs:

  1. Write pitch for authors along the lines of “Think you have a book in you? Join the Minireference Co. content team, and get paid to write about your favourite subject.”
  2. Update website, adding a new /authors endpoint.
  3. Think about revenue sharing models. Contractors? Royalties? Advance? Write contracts.
  4. Write a white paper on self-publishing tools. Package and release LaTeX templates and ePub production scripts for use by other authors.
  5. Develop scripts for publishing workflows based around text sources (md/tex), github repos, diffs, typo fixes, and multi-author collaboration. [BACKLOG]

Distribution platforms

Given the effort involved in producing educational content, it makes sense to distribute it as widely as possible. We need a multimedia approach. The print books are good.

Distribution TODOs:

  1. Create the split-versions of the first book for Kindle: No bullshit guide to math, No bullshit guide to mechanics, No bullshit guide to calculus. [June 2016]
  2. Finalize LA book, and push it to Lulu, Amazon, and Ingram channels. [August 2016]
  3. Release a iOS and Android apps with book content. Keep it simple: use a basic  ListView for browsing the topics and  WebViews (HTML+MathJax) for each topic.  [Summer 2016]

The above goals are easy to achieve and totally worth doing. The last thing you want to do in business is to waste time. Every week that I’m not on the kindle store means hundreds of dollars of unrealized sales. The LA book needs to ship ASAP too. People have been waiting, for so long.

New products

Books are good and all, but we need to think about the future. Will print book still be around 50 years from now? Maybe. But surely technology can play some role. Below are some product ideas that I plan to test in the coming years.

  1. Email course. Adult learners who are learning math and physics on their own need a little structure—a series of emails to keep them on track with their studies. Imagine a sequence of 10 emails that walk you through the sections of a chapter. Each email can contain links to lessons, video tutorials, exercise sheets.
  2. I’ve been experimenting with video tutorials and notebooks. I’m very impressed with the efficiency of teaching using jupyter notebooks and SymPy. I also like the “walkthrough” model of teaching, based on the book. But do the video lessons work? Are they effective at delivering the knowledge? Should they be at 1x, 1.5x, or 2x playback by default?
  3. Mobile applications. Everything has to be mobile these days. There is an opportunity to reach a wider audience through the Google Play Store and the Apple App Store. The plan for this project is in two steps: MVP as a Free app (lessons, concept map, exercises) [DEMO] Introduce paid apps based on feedback and experience of the free app
  4. EXERCIS. No learning is complete without putting the new knowledge into practice. That’s why I need to develop an exercises framework. It’s time I invested some dev efforts into this. I won’t be starting from scratch, but use khan-exercises or edX stack. I can offer it to readers either as a free bonus (incentive to buy book), or as part of the “deluxe” edition of the book. With the exercise framework packaged as a standalone JavaScript application, it can be distributed to students to use offline, or used from inside a WebView in the mobile applications.
  5. STRUCTURE. For as far back as I can remember, I’ve been obsessed with building a graph-like structure to describe the connections between all subjects, topics, and concepts in science and math. Now’s the time to finally build it! Strictly speaking, the graph by itself is not a product but the base for other products. For example “a concept browser” could be used to help people orient themselves in any field. Also a “what to learn next” recommender system can be build based on the knowledge of prerequisite structure between concepts.

These are all nice projects, but each of them requires a lot of development effort. I will need help. I could potentially try to pull it all off on my own, but it would be much faster to get interns to help me, or hire contractors. It’s not something I’m experienced with, but I think if I write solid specs for all these products, I could get external help.

 

Marketing push

With the two books in print (through lulu, amazons, Ingram) and digitally (gumroad, kindle), it’s now time to invest some cash and effort in a marketing campaign. A friend of mine who works in advertising recommended using a 30sec youtube video ad. Given a budget of \$20k for this, producing the video would take around \$10k and another \$10k would be used for the ads. If the video is good, such a campaign could lead to \$20k in sales. And if ROI>0, then I should do it, right?

I should really have a presskit for the company, and reach out to the tech news outlets and the startup community. Surely there is some free publicity to be had. The general themes of expensive textbooks will surely receive attention. Not sure how to spin it, but it’s definitely worth investing into this now that v5.1 of the math book is solid, and once v1.0 of the linear algebra book comes out.
Exercise framework

I’m a little disappointed by the referral page I setup for Shoutly. It’s probably my fault for not putting more thought and effort into it. Despite this failure, I still think there is a lot of potential for a referral program when setup right. If I can reach one student in a class of 300 undergraduates and incentivize her to recommend the book to her classmates, then I’m golden. Giving her a cut of sales profits could be good, but maybe there are other ways too? What if she can setup a “discussion group” for her class, with a unique URL. She won’t be “pushing” the book directly, but setting up a community for her class. Then again, I’m sure there are facebook groups for this already.

 


 

I’ve got many other ideas brewing too, but I don’t want to spread myself too thin. Instead of hiring authors, I could focus on the publishing technology, content curation, and recommendations. I recently bought EZOER.COM which would be a nice home for such a project. The best part about OER is you can still sell the print book. You can’t charge a huge margin, but it’s not like I’m very extractive right now either.

 

So, lots of things for Summer 2016. I better move my desk closer to the coffee machine

Git for authors

Using version control is very useful for storing text documents like papers and books. It’s amazing how easy it is to track changes to documents, and communicate these changes with other authors. In my career as a researcher, I’ve had the chance to initiate many colleagues to the use of mercurial and git for storing paper manuscripts. Also, when working on my math books, I’ve had the fortune to work with an editor who understands version control and performed her edits directly to the books’ source repo. This blog post is a brainstorming session on the what a git user interface specific to author’s needs could look like.

The other day I was onboarding a new author and had a chance to explain to him the basics of git, and I realized how complicated the action verbs are. To save some work, you need to put files in the staging area using git add <filename>, commit the change to the local repo, then push the changes to the remote repo. These commands, and the corresponding commands for pulling changes from the remote repo to your local one, and updating your working directory from the local repo, are very logical after you get used to them, and represent necessary complexity. The diagram below illustrates well the different git verbs newcomers to git need to get used to.

git verbs explained

(Credit: Kieran Healy‘s excellent guide to git)

 

So what would git for authors look like?

It’s my non-expert opinion that this is too much complexity for the average non-technical person. Imagine a teacher who wants to use an OER textbook with her students, and in the process of producing the document for her class she finds some typos, which she wants to contribute back to the OER textbook project. Let’s do a thought experiment and imagine a humane interface that would make sense for this task. To make the thought experiment more concrete, we’ll personify the teacher as Jane,  a university professor who is in charge of a first-year physics class.

We’ll assume github is used as the storage backend, but most of author’s OER browsing,  and collaboration happens on a different site (say ezOER.com) whose users are authors, teachers, students, and parents. Suppose the OER book that Jane wants to use is College Phyisics by OpenStax, and this book is available in “source” format from the github repo openstax/physics, which we’ll refer to as upstream below. Given this preexisting setup, here are the steps the teacher would use:

  1. Login to ezOER.com
  2. Copy openstax/physics  to janesmith/physicsbook  (note we don’t say “fork” because it has different connotation as to the permanence and authority of the repo)
  3. Clone janesmith/physicsbook to her ~/Documents/School/Textbooks/OpenStaxPhysics
  4. Follow instructions for “building” the book locally. (e.g. running pdflatex three times)
  5. Performs customization like:
    1. Change cover page
    2. Remove chapters she doesn’t plan on covering in her class
    3. Add a custom preface with references specific to her class
    4. Choose values for “configuration variables” like font size, paper size, etc.
  6. Generate custom book for her class (PDF for print, PDF for screen, .epub, and .mobi)

At this point, she can distribute the eBooks to her students using her school’s LMS’ “file uploads” feature and setup the print PDF for print-on-demand using lulu.com, so students will be able to order the book in print. Her students will benefit from a world-class textbook for $20-30 when printed as a two-tome softcover, black-and-white print book. No payment or further engagement with ezOER.com would be required.

If she doesn’t like her school’s LMS system she could “host” her custom book on ezOER.com. These are the steps she would take to publish her changes to her public-copy repository ezOER.com/janesmith/physicsbook:

  1. git save: combines the effect of git add and git commit using a two-prompt wizard
  2. git publish

She could now give the links to the “build” directory of ezOER.com/janesmith/physicsbook.

Now suppose that halfway through the course, she finds some typos in Chapter 2 of the book, which she wants to correct, and furthermore she wants to share her corrections with the “upstream” copy of the textbook. (Bear with me with this scenario, we’ll have to think more about good incentives to share your corrections with others, but for the purpose of this thought experiment let’s assume Jane is feeling altruistic today). These are the commands she’ll have to use to “suggest edits” to the upstream authors who manage openstax/physics:

  1. Make the corrections in her working directory
  2. git save
  3. git publish (to her copy)
  4. git suggestedits which pops up a wizard asking her to give a short label for her edit suggestions, and pick the commits that should be part of the “suggested edit” (a pull request behind the scenes). The suggestedits command will perform the following steps behind the scenes.
    git checkout -b typoFixesChapter2
    git rebase -i   (choosing only corrections commits, and not the customization commits)
    – open github pull request

To keep things simple, Jane will never be shown the typoFixesChapter2 branch, and for all intents and purposes the rest of the workflow will be done entirely through the ezOER.com web interface. For example, if the upstream maintainers wants her to change something in her “suggested edits” (pull request), she’ll have to make these changes through the web interface, rather than edit the branch typoFixesChapter2 and push again. For all intents and purposes, Jane is always working on the master branch of her copy of the book.

I think introducing the new verbs save, publish, and suggestedits would be easier to use and correspond more closely to authors’ needs.

More power tools for authors

Assuming the source format is text based, git’s basic diff functionality will prove to be useful for “watching” changes made to large collections of text.  If the source is LaTeX documents, ezOER could run latex-diff to generate diff documents showing “rendered” differences between revisions, also know as red-blue diffs.

The build process could be automated using a generic continuous integration server. A script could run after each commit to regenerate the book in various PDF and eBook formats, and also generate diffs. We could even have some “language checks” scripts, that act like linters for text.


 

I’ve thought about this previously, but now the “authoring workflow” is becoming clearer. I need something like this for managing Minireference Co.’s (closed-source) content, but I plan to build all the tooling as open source. Would love to hear you feedback about this idea in the comments below.