Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you're checking that 17 isn't a typo, do a screen grab and doodle on the graph. For each vertex, write down how many ways you can get there in two steps from v1. There are the same number of ways to get back, so you sum the square of these numbers. That's the dot product (3,1,1,1,1,2) with itself, 9+1+1+1+1+4 = 17.

The (1,1) entry of the matrix multiplication of A^2 with itself is exactly this calculation. Matrix multiplication is a dance one sees everywhere. It's crippling to teach young minds that matrix multiplication is composing linear functions, when the dance shows up so many other ways.

Path counting is for example at the heart of automata theory in computer science. For a finite state machine, the question becomes "is there a path?" rather than "how many paths?" Think of 0 as false, and any positive integer 1, 2, 3, ... as true, and one sees this same dance in automata theory.



"how many ways you can get there in two steps from v1" If it's not obvious, v1=3, v2=1, v3=1, v4=1, v5=1, v7=2.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: