C1W4 Exercise 3

1 Like

Yes, you’re right: I don’t know why they suggest doing things in that complicated way. I also did it by taking advantage of “broadcasting” and it works fine and passes the grader. Much simpler code to write. Simpler is better!

It’s been a while since I watched the lectures here, but maybe they just didn’t want to explain how broadcasting works. I was a math major back in the day, so I remember when I first saw broadcasting maybe 10 years ago, I thought it was kind of a shocking violation of the underlying pure math concepts. And it could have nasty unintended consequences if the dimension mismatch was just a bug by a careless user, but once you get used to it, it sure is convenient. :nerd_face:

1 Like

Thank you for your answer.