pervognsen,
@pervognsen@mastodon.social avatar

This classic blog post resurfaced on the Rust subreddit today after someone posted that they wished ownership had been explained to them with a metaphor about pirate treasure chests.

https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/

'But now Joe goes and writes a monad tutorial called “Monads are Burritos,” under the well-intentioned but mistaken assumption that if other people read his magical insight, learning about monads will be a snap for them. “Monads are easy,” Joe writes. “Think of them as burritos.”'

pervognsen,
@pervognsen@mastodon.social avatar

(I think Yorgey is overstating the extent to which everyone needs to begin with the concrete and move to the abstract. By programmer standards, I'm probably more on the side of learning quickest from looking at the general case first, and when I spent most of my time around other mathematicians in college I met people who had a really hard time "getting it" from examples but could much more immediately grasp abstract concepts if presented directly.)

zwarich,
@zwarich@hachyderm.io avatar

@pervognsen Also, unlike in mathematics where the concrete examples are always instances of the general concept, some of these real-world examples for programming are pretty bad. Who actually stuffs a burrito with another burrito?

pervognsen,
@pervognsen@mastodon.social avatar

@zwarich One of my favorite example-driven math books is Shafarevich's Basic Notions of Algebra but I've never been able to tell who it was intended for, exactly. Right after giving the definition of a ring homomorphism he will give you ten pages of examples like this.

pervognsen,
@pervognsen@mastodon.social avatar

@zwarich You still have trouble understanding what a ring homomorphism is, second-year student? Maybe this one helps.

pervognsen,
@pervognsen@mastodon.social avatar

@zwarich I'm pretty sure it's not intended as a pedagogical text, but for someone who already knows most of the material it's a treasure trove of examples and connections to other parts of mathematics.

pkhuong,

@pervognsen @zwarich It's been a while, but I feel like that's also how https://dms.umontreal.ca/~broera/ did intro to algebra in his course notes.

pkhuong,

@pervognsen @zwarich I didn't get it at the time, but now I think you have to go wide and hope one example makes things click, and a couple others can serve as counterexamples.

pervognsen,
@pervognsen@mastodon.social avatar

@pkhuong @zwarich The other thing is that it's impossible for almost anyone to learn a non-trivial thing sufficiently in "one pass". So if you're psychologically stuck on wanting to completely understand everything before proceeding, you will never get to understanding. One of the joys of learning is that you get to revisit the basics throughout your life and understand them a little bit better each time. But especially with your first encounter, you just need to trust the process.

pervognsen,
@pervognsen@mastodon.social avatar

@pkhuong @zwarich You see this even with basic arithmetic. How many people (good math students) really understand long multiplication, never mind long division, to the extent that they could explain how it relates to the more primitive concept of addition and multiplication as counting from first grade? But kids at that age seem more willing to just go along with it. It's when you get older that people (especially adults) get stuck on wanting to understand things before letting themselves learn.

steve,
@steve@discuss.systems avatar

@pervognsen @pkhuong @zwarich how many people even understand addition? https://ncatlab.org/nlab/show/carrying

pervognsen,
@pervognsen@mastodon.social avatar

@steve @pkhuong @zwarich I already know this is going to be about 2-cochains, Steve.

steve,
@steve@discuss.systems avatar

@pervognsen @pkhuong @zwarich that’s right, it’s very simple, carrying is a 2-cocycle in the group cohomology, hence a morphism of infinity-groupoids

pervognsen,
@pervognsen@mastodon.social avatar

@steve @pkhuong @zwarich I learned that factoid from reading old James Dolan posts on sci.math.research!

pervognsen,
@pervognsen@mastodon.social avatar

@steve @pkhuong @zwarich Anyway, my point wasn't so much that people don't understand multiplication and especially long division, but that if we had applied the standard of wanting to deeply understand things before going through a learning process we would all still be stuck at long multiplication, probably. But I do have a personal anecdote about long division that shocked me, when I realized after already being in university for math that I hadn't understood the role of quotient estimation.

pervognsen,
@pervognsen@mastodon.social avatar

@steve @pkhuong @zwarich Basically I was trying to figure out how to implement long division for arbitrary-precision arithmetic but with base 2^32 so you can use machine arithmetic as an efficient basis set of operations. And that's when you realize that small bases let you kind of brush the question of quotient estimation under the rug to the point where I hadn't even noticed it was happening in decimal long division.

pervognsen, (edited )
@pervognsen@mastodon.social avatar

@steve @pkhuong @zwarich And that's when I finally folded and looked it up in Knuth and of course it's quite subtle: you can get away with looking at 3 leading digits of the dividend and 2 leading digits of the divisor, if you're in a power-of-two base, if you re-scale so the divisor's leading digit's MSB is 1, if you're okay with sometimes being off by 1 in the quotient estimate (which can be detected and fixed in one step). Probably got that wrong, but in any case it's not trivial.

pervognsen, (edited )
@pervognsen@mastodon.social avatar

@steve @pkhuong @zwarich "Guess (and verify) the next quotient digit" sure works a lot better in base 10. Of course you can do binary search in base 2^n to guess more efficiently but that's effectively reducing to base 2, which is the ultimate cheat move.

Much later I found this technical note by Per Brinch-Hansen who has a stepwise discussion and development of how to do it. I believe he recommends (for tutorial purposes) a less tight estimate that can be off by 2 or 3 in the worst case.

pervognsen,
@pervognsen@mastodon.social avatar

@steve @pkhuong @zwarich Multiple-Length Division Revisited: A Tour of the Minefield (1992), Per Brinch-Hansen, https://surface.syr.edu/cgi/viewcontent.cgi?article=1162&context=eecs_techreports

"Only a handful of textbooks discuss the theory and practice of long division, and none of them do it satisfactorily. This tutorial attempts to fill this surprising gap in the literature on computer algorithms."

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • Youngstown
  • everett
  • slotface
  • rosin
  • osvaldo12
  • mdbf
  • kavyap
  • cubers
  • megavids
  • modclub
  • normalnudes
  • tester
  • khanakhh
  • Durango
  • ethstaker
  • tacticalgear
  • Leos
  • provamag3
  • anitta
  • cisconetworking
  • JUstTest
  • lostlight
  • All magazines