Graphical Linear Algebra Post 4 on 2019-02-14

This is the 4th post in a series of daily posts on my Timeboxed Challenge to learn Graphical Linear Algebra (GLA). The source material would be the 30 episodes from the Graphical Linear Algebra blog. If you prefer to read my series from the beginning, start here with the first post. For today’s post, I will cover the concepts of Associativity, Zero, and Unit. 


Still the same Episode 5 – Spoilers, Adding (Part 2) and Zero

From the last post we ended talking about how composition acts on generators. The last example I gave was this one.

Fig 1

Pawel covered more examples in Episode 5 which I will replicate here. I wrote this series primarily more for my own learning. To consolidate my understanding better of this, I will replicate more of the examples Pawel showed in the same episode.

More Examples of Composition

Fig 2.1 (3,2) ; (2,1) = (3,1)

and

Fig 2.2 Also (3,2) ; (2,1) = (3,1)

This brings us to the next thing Pawel wanted his readers to learn.

Associativity

Associativity is just a technical term to describe where you put the brackets doesn’t matter for that operation. The classic example is addition. From my own memory of my secondary school mathematics textbook,

(x + y) + z = x + (y + z)

In fact, Pawel used the same concept involving addition to explain the associativity of composition with more diagrams.

The key diagrams are:

Fig 3.1 Proving the associativity based on the previous 2 diagrams

Using the (x + y) + z = x + (y + z) example to hammer in the associativity concept.

Fig 3.2 This is (x + y) + z
Fig 3.3 This is x + (y + z)

Just like how for Commutativity, Pawel showed a (I called it a blackboxed representation) of Associativity.

Fig 4.1 A reminder of the “blackboxed” representation of commutativity
Fig 4.2 Similarly, this is for associativity

Zero

Pawel goes into a long spiel about how zero is one of those rare, great scientific breakthroughs. Once again, I enjoyed those long spiels very much. But because, this series of posts aims to focus only on the absolute essentials. I have to skip all of that.

The key thing about zero, Pawel told us, is that it’s an additive identity.

Zero is the Additive Identity

Fig 5: A graphical representation of zero

And how it works can be best understood with an example.

Fig 6.1 : How zero as part of a generator to equal (1,1)
Fig 6.2: Same generator but with algebra in it

Unit – the Third Equation About Addition

Just like how we have the diagrams for Commutativity, and Associativity, the diagram 6.1 shows Unit. Now, I feel that this should be made clearer. And it doesn’t help that I have never come across this term in my old mathematics textbook. So, this is one of those “just accept it as it is for now” concepts.

In fact, Pawel says that Commutativity, Associativity, and Unit are the three equations we need to learn about addition. He also adds another point after that. Any structure (what’s an example of structure?) that satisfies the three properties of Commutativity, Associativity, and Unit are called commutative monoids. There is a link to the wikipedia definition to commutative monoids. But, trust me. It doesn’t really explain anything if you don’t math well. And I don’t math well.

Conclusion and Looking Ahead

Let’s sum up what I have learned in today’s post.

  • Associativity via examples of composition
  • The diagram for Associativity
  • Zero is the additive identity
  • The diagram for Unit (though I’m still not sure what Unit means)
  • The term commutative monoid
  • And that it’s the name for structures that satisfies all three properties of Commutativity, Associativity, and Unit

Pawel ends Episode 5 talking about using only diagrams to prove the following.

Fig 7: The upside down Unit.

But, when I look ahead at Episode 6, I must say I find his examples involving a cooking recipe far more interesting than the proof of Fig 7. I guess, that has more to do with me being a developer. In any case, I will study that in greater detail for tomorrow. See you tomorrow.

This is post #10 in my quest for publishing weekly.

As usual, all diagrams that are shown here were taken directly from Pawel’s blog at graphicallinearalgebra.net. All credit goes to him regarding the explanation of the idea. I merely gave my take on his explanation.

Graphical Linear Algebra Post 3 on 2019-02-13

This is the 3rd post in a series of daily posts on my Timeboxed Challenge to learn Graphical Linear Algebra (GLA). The source material would be the 30 episodes from the Graphical Linear Algebra blog. If you prefer to read my series from the beginning, start here with the first post. For today’s post, I will cover generators, special generator names, and how direct sum and composition act on generators.


Episode 5 – Spoilers, Adding (Part 2) and Zero

I have limited time today to read and study Episode 5 completely. Most probably I have to split Episode 5 into at least two separate days of posts. Today’s post will specifically introduce two technical terms — generator and identity. Adding to it, we will see how direct sum and composition affect generators.

Generators — Another Name for Basic Diagrams

In my last post (the one with dozens of Lego pictures), I learned from Pawel Lego bricks are useful for learning about GLA. Well, they were precursors to the basic diagrams in GLA. One such basic diagram or generator, as they are called, looks familiar.

Fig 1: A basic diagram or generator

We actually have seen this in Episode 3 before. I have reproduced this as a notation in Post 1 – On Matrix Notation and Dangling Wires to explain our normal arithmetic addition sum.

Fig 2: Remember this from Post 1?

So this is a generator. Remember it. Though I must say, Pawel did not explicitly state what diagram is NOT a generator. For now, let us mothball that question. Perhaps it will be answered in future episodes.

Special Generator Names

Now, we have specific names for specific kinds of generators. Not too sure how useful to learn the names, but we’ll just go with it for now.

Identity – Just Your Typical (1, 1) Generator

When you have a Magic Lego brick with 1 hole and 1 stud, this is an identity. Well, I mean, a generator that’s (1, 1).

Fig 3: Identity

Twist – The (2, 2) Generator that Literally has a Twist

And a (2, 2) generator called a Twist. Which is aptly named because it has a twist in its middle.

Fig 4: Twist

How Direct Sum Affects Generators

If you can recall how Direct Sum affects our Magic Lego bricks, you should have no issue with using Direct Sum on generators. It’s exactly what you expect.

Fig 5.1 One way of using Direct Sum
Fig 5.2 Here’s another. Proving that direct sum is NOT commutative

How Composition Affects Generators

Again, just recall how composition works on Magic Lego bricks and you’ll be fine.

Fig 6

A gentle reminder about composition. The left studs must match the right holes for composition to take place.

Another reminder. As long as two diagrams share the same number of holes and studs, they are considered as equal.

Fig 7 These two diagrams are equal based on holes and studs

Conclusion and Looking ahead

A quick summary:

  1. A basic diagram is called a generator
  2. Generators are what the Magic Lego bricks were referring to. For the past few episodes.
  3. A (1, 1) generator is called an identity.
  4. A (2, 2) generator with a twist in the middle is called a twist.
  5. If you recall direct sum on Magic Lego, it works the same way on generators.
  6. If you recall composition on Magic Lego, it works the same way on generators.
  7. Gentle reminder 1: composition has a condition where the left studs match the right holes.
  8. Gentle reminder 2: two diagrams are equal when they are said to have same number of holes and studs.

Looking ahead, the last part of Episode 5 is covering more composition and a new property called associativity. Finally, it ends with an explanation about zero. I’m looking forward to covering that in tomorrow’s post.

This is post #9 in my quest for publishing weekly.

As usual, all diagrams that are shown here were taken directly from Pawel’s blog at graphicallinearalgebra.net. All credit goes to him regarding the explanation of the idea. I merely gave my take on his explanation.

Graphical Linear Algebra Post 2 on 2019-02-12

This is the second day of my Timeboxed Challenge. On the first day, I summarized the first three episodes in the GraphicalLinearAlgebra blog. I doubt I will cover as many episodes in today’s post. In episode four on Magic Lego, Pawel spent the first 500 words addressing complaints about his writing style. In essence, people want him to be more concise. Shorter. Personally, I enjoyed his digression from time to time. It helps break up the monotony of dense material. Pawel also mentioned about the London Review of Books which he subscribed to. His admiration is clear in his own words here.

The authors, who are usually domain experts, make their subjects extremely clear to a lay audience, but without dumbing them down. They take all the space they need and they respect their readers.

That’s also a sentiment I admire greatly. If I get anywhere near that level of writing, I’ll be hugely pleased. Hence, my publish weekly challenge 2019 as part of the Year of Consistency theme to get better at writing.

They take all the space they need and they respect their readers.That’s also a sentiment I admire greatly. If I get anywhere near that level of writing, I’ll be hugely pleased. Hence, my publish weekly challenge 2019 as part of the Year of Consistency theme to get better at writing.

Episode 4 – Dumbing Down and Magic Lego

This episode is centered around Magic Lego bricks. I assume these Magic Lego bricks are a bridging tool into the Graphical Linear Algebra (GLA) concepts. When I completed this episode, Pawel did not reveal how these Magic Lego bricks are analogous to GLA concepts. I expect Pawel to continue using Magic Lego bricks for some time.

Because this is a summary, I will be more concise than Pawel. Read his post if you prefer the whole treatment. In essence, via Magic Lego bricks, he wants to teach you six concepts.

Concept 1: An Operator Called Direct Sum

Pawel explains direct sum (represented by this symbol ‘⊕’) using this example.

Fig 1
Fig 2

The way I understand this is simply that direct sum ⊕ is about joining bricks in the vertical dimension. And that the order of the arguments matters. In fact, Pawel emphasized the importance of the arguments order as well. He pointed out that direct sum ⊕ is NOT commutative. Unlike the + operation we learn in previous episodes.

In case you are unsure, arguments refer to the values for any operation. Recall 3 + 4 = 7 example in my last post? So arguments for + operation are 3 and 4. Back to our article.

Concept 2: A Second Operator Called Composition

Direct sum is an operator. Pawel then covers a second operator called composition (represented by ‘;’).

Fig 3
Fig 4

In Fig 3 and 4, I see that composition is an operator that acts on the bricks in horizontal dimension. Bear in mind, the use of the phrase “vertical and horizontal” are entirely my own paraphrasing.

Once again, this operator composition is also NOT commutative.

Concept 3: A Magic Lego Brick can be Represented as Holes and Studs

You can represent a Magic Lego brick as a set of two numbers (holes, studs). To remember which number comes first, I recommend remembering it as alphabetical order. Since holes is alphabetically before studs, you get (holes, studs). Fig 5 below shows us how different bricks are represented in this format.

Fig 5

Concept 4: When Compose is Allowed and Forbidden

After explaining the 3 concepts, Pawel introduced the notation for direct sum and composition. I’m not going to follow that order. I prefer the visual examples of the Lego bricks, so I’m going to continue that for a while longer. The next thing to understand is that certain situations, we cannot perform compositions.

Fig 6

In Fig 6, we have a Lego brick that has two studs on the left. On the right, we have four holes. This is not allowed in composition. In deliberately broken english, I will summarize this way. Composition is allowed when left studs equals right holes.

This point is so important. I want to repeat it.

Composition is allowed when left studs equals right holes.

This means we have some weird situations when composition is allowed.

Allowed Compositions

Fig 7

Fig 7 is allowed. We have two studs on the left and two holes on the right. So this composition is allowed. What the outcome looks like has two possibilities.

Fig 7.1
Fig 7.2

Both outcomes are the same. This is where the Magic in Magic Lego is referring to.

Fig 8: Both outcomes are the same thing

The Magic-ness is not limited to composition. Which brings us to the next concept.

Concept 5: Direct Sum also has Magic Outcomes

Fig 9

This is also allowed in direct sum. The Magic works in the sense that we can’t tell the difference between plates and bricks.

Concept 6: Representing Direct Sum in Notation

Now, we’re ready to talk notation! Direct Sum is represented in this notation.

Fig 10: The rule for Direct Sum

Let’s go through this part by part. Notice how this has a top part (above the line) and bottom part (below the line). The top part represents assumptions. The bottom part represents conclusions.

Assumptions

Let’s go through the assumptions first. Reading from left to right, we understand that we have two bricks, X and Y. X has k holes and l studs. Similarly, Y has m holes and n studs. That’s basically it.

Conclusions

So when you read the whole formula, it becomes assumptions such that conclusions. We have :

  • X with k holes and l studs and Y with m holes and n studs
  • such that
  • when X direct sum Y, we get a new brick with (k+m) holes and (l+n) studs

Concept 7: Representing Composition in Notation

If you skip the previous concept, please go back. Else, this is pretty much the same idea. Start with the assumptions and then work your way through the conclusions.

Fig 11: The rule for Composition

One thing I like to bring your attention to is the fact that the stud in X is the same as the holes in Y. Both are represented by the letter l. This is exactly the concept I covered in Concept 4 earlier. For completeness sake, I will explain the notation from top to bottom again. We have:

  • X with k holes and l studs and Y with l holes and m studs
  • such that
  • when X composition Y, we get a new brick with k holes and m studs

Conclusion

Rounding this off, we learn that:

  1. There’s an operator called Direct Sum and it’s not commutative.
  2. A second operator called Composition and it’s also not commutative.
  3. A Lego Brick is represented by (Holes, Studs).
  4. Composition is allowed only between X and Y when the studs in X is the same number as the holes in Y.
  5. There’s no difference between plates and bricks in Magic Lego Bricks combining through Direct Sum or Composition.
  6. The notation that explains Direct Sum between X and Y bricks producing a new brick whose holes and studs are the sum of the holes and studs of X and Y.
  7. The notation that explains Composition between X and Y bricks that need X studs to be the same number as Y holes. This will produce a new brick that has the holes of X and the studs of Y.

See you tomorrow!

This is post #8 in my quest for publishing weekly.

As usual, all diagrams that are shown here were taken directly from Pawel’s blog at graphicallinearalgebra.net. All credit goes to him regarding the explanation of the idea. I merely gave my take on his explanation.

Graphical Linear Algebra Post 1 on 2019-02-11

Due to unexpected circumstances, I couldn’t spend more time studying the GraphicalLinearAlgebra blog. Thankfully, the first two episodes were your typical introductory material. So they touched on big picture stuff about linear algebra and category theory. I was able to peruse them quickly. I was also able to cover what a matrix is, what a graphical notation is, and the concept of dangling wires.

Episode 1 – Makelele and Linear Algebra

In the first episode, it compares linear algebra with a famous footballer ( Claude Makélélé) in a more famous team (Real Madrid). The analogy was to point out that linear algebra is the highly critical yet unsung hero in the field of science and mathematics. Much like Makélélé.

Then, it introduces matrix to end the episode. A matrix is, basically, a double array of numbers. We describe the matrix as a row x column. So if it’s 2×3 matrix, it’s a matrix with 2 rows and 3 columns producing 6 numbers.

A 2×3 matrix

Episode 2 – Methodology, Handwaving, and Diagrams

In the second episode, Pawel Sobocinski goes into more detail about his plans for the series. There are only a few key points I like about this episode that I want to highlight.

  1. He promised not to “handwave“. In fact, he asked for specific feedback when he does indulge in handwaving. Which is an admirable stance.
  2. He forewarned about having lots of diagrams. Hence, the “graphical” in Graphical Linear Algebra. Pawel promised how in future episodes, a diagram can even tell a thousand formulas.
  3. Pawel mentioned about category theory. He even added that “category theorists are comfortable with diagrams”. And going forward, he will “use category theory to do graphical linear algebra.” Not sure what that means exactly, as I have only the vaguest notion of what category theory does.

So far so good, all simple stuff. Both episodes can be glanced through without any significant loss of understanding. Now, we come to the first real challenge of learning Graphical Linear Algebra in Episode 3.

Episode 3 – Adding (Part 1) and Mr Fibonacci

In this episode, Pawel used the example of a simple addition formula to illustrate the use of graphical notation. As I’m writing this, I also found myself going back and forth between the blog and this draft. So if this sounds more like sports commentary than a proper summary, do forgive me.

Back to the summary. Pawel started with showing simple mathematics formula can be represented graphically like this.

3 + 4 = 7

Notation for 3 + 4 = 7

And then he digresses into a story on Fibonacci and the Hindu-Arabic numeric system. Which I rather enjoy to be honest.
Because I’m assuming we’re going at the level of the freshman lecture, let me be direct here. In this episode, Pawel is trying to teach us the notation for commutativity via addition.

Commutativity is this fancy term to say that

∀ x,y.  x + y = y + x   

Another way to say this out loud is for all values of x and y such that, x + y = y + x.

And the notation for the above formula can be represented as:

This means the same as ∀ x,y.  x + y = y + x   

Then Pawel did highlight one key point for graphical linear algebra.He mentioned when we have an equation between two diagrams, the number of dangling wires on the left and right of both diagrams must be the same.

If we reference the last notation, we can see how that is true. On the left diagram, we have 2 dangling wires on the left and 1 on the right. For the right diagram, we have the exact same number of dangling wires on the left and right of that diagram.

Note the left diagram and the right diagram have the same number of dangling wires

Generalized form of addition

Finally, Pawel appears to be teaching us a general form of the diagram in the Comm equation. He says that both the left and right diagrams with their dangling wires can be presented as:

This has 2 left dangling wires and 1 right dangling wire. Same as the diagrams in the above equation.

Looking ahead to Episode 4

That’s it for now. Tomorrow, I will continue with another episode. I have previewed the next episode ahead of tomorrow’s summary. It appears that I won’t be able to compress multiple episodes into 1 blogpost summary like I did here anymore. In fact, I may need posts stretching over several days to summarize my thoughts for one episode going forward.

I’ll cross that bridge when i get there. In the meantime, thank you for reading.

This is post #7 in my quest for publishing weekly.

All diagrams that are shown here were taken directly from Pawel’s blog at graphicallinearalgebra.net. All credit goes to him regarding the explanation of the idea. I merely gave my take on his explanation.