Remix.run Logo
How many dimensions is this?(lcamtuf.substack.com)
121 points by robin_reala 8 days ago | 46 comments
lordnacho 4 days ago | parent | next [-]

It's always puzzled me how many of these interesting things are not in a standard math course.

I recall doing a 4th year "advanced mathematical techniques" course where they went over the basics of graph theory and RSA algorithm. Descrete maths. This kind of thing is not the intensive calculus that people get told is math in high school, but a high schooler could do it if you showed them.

IanCal 4 days ago | parent | next [-]

There's a load of things I think are things many kids could do much earlier in maths, though my personal feeling may be off. My son seems to be taking very quickly to the feeling of maths so I'm trying to share some parts that I only realised drastically later on.

Rules you learn in maths are often based on much simpler, truer (I'll get back to this), things. I learned loads of "move this denominator up to this side, like an escalator!" and such and only when I was something like 13 I nearly shouted "EQUALS MEANS THE TWO SIDES ARE THE SAME THING" as I realised why so many of these god damn rules existed. It also explained suddenly why some things are OK to do and some aren't (notably taking roots).

The other key thing was finding out that these things are decisions. We can choose whatever rules we want and see what happens, and keep whatever is useful. Lots of the more interesting things I've seen later in life have been "well there's no number you can square and get a negative number. What if there was?" or "What if there was a way to raise to a real number, what would that mean?". There's no magical reason we can't divide by 0 but there's not a neat useful answer really, but you can totally define a setup where you can do that and have fun if you want.

Imaginary numbers and Argand diagrams are things my 6 year old can mess about with. He's still developing reasoning so certain things trip him up about seeing the process for solving a thing (fascinating to see where his comprehension is up to and the leaps that happen, I remember the first time seeing him pick up a chess piece, go to move it and before putting it anywhere say "no, if I do that you'll do X") but lots of things are very accessible. Powers are fun because you can make big things quickly, factorials too. Basic solving of equations I was only taught in secondary school yet I was taught "two bananas cost 30p and one banana and one apple costs 40p, how much is one apple" years before and that's just swapping fruit for letters.

I was always good at maths, but I think it's far more fun now I've understood more about what you can mess about with and how simple parts are at times.

jerf 4 days ago | parent | prev [-]

This is one of the reasons whenever the topic of math curricula comes up on HN I've tended to argue to remove some things. The system is full up at the moment and you can't really add anything without removing some things. But I can't even get HN readers to agree that some things should be removed, let alone normal people. Everyone wants to add but no one is willing to remove anything, no matter how useless it is for all purposes practical, mathematical, scientific, and every other purpose. With the curriculum highly centralized and standardized, change to what is taught has proved to be on the scale of multiple decades if not centuries, and not in a good way.

Changes to how The Holy Curriculum is taught can occur on decades, but what has changed hardly at all, despite the fact that frankly the curriculum was audibly creaking when I was doing it in the 1980s... at least, if you tried to hear the creaking. Even then it was obvious that what we were being taught had been frozen circa 1930 or 1940 and needed updating for a number of reasons. It's even more out of step with the world now, in every way, but here we are.

acoustics 4 days ago | parent | next [-]

What do you propose to remove?

Personally, I'd say that geometry and trigonometry seemed the least useful out of the high school math sequence. Trigonometry seemed like "Algebra 3: this time with identities to memorize" and geometry seemed mostly like an homage to Euclid. In my day-to-day life, algebraic thinking comes up much more often than geometric thinking, although of course I know this is not universally true.

Geometry is the classic introduction to proof and rigor, but if I were the benevolent dictator of the math curriculum, I would try to accomplish that with basic combinatorics, graph theory, or even a tiny bit of abstract algebra (proving basic arithmetic facts from the real number axioms, maybe modular arithmetic).

a day ago | parent | next [-]
[deleted]
jerf 4 days ago | parent | prev [-]

A lot of trig. Trig identities is my bête noire, though I would save off one day for them, after Taylor polynomials, to derive a few through practice that way. But I remember grinding on them for quite a while; I would just have one day and use them as Taylor fodder. (Taylor polynomials are not practically useful for most people but they are extremely important as "the simplest thing that converts transcendental functions into the world of the elementary arithmetic functions"; it is good to demystify how one might compute sine or cosine "from scratch".) But I wouldn't nuke trig out entirely as classical geometry is an almost unparalleled place to learn basic proof techniques and mathematical thinking in a playground where you are not distracted by a lot of arithmetic. I think I still like that better than graph theory, and simple trig/geometry is in fact practically useful for a chunk of the students we're pushing through these courses. It would just get toned down.

I would cut out a lot of integration grinding. The concept of integration is extremely important, and I want the students introduced to the ideas of doing it symbolically, but the details of all of the manipulations are much less important than the concepts. I would retain only things that are of mathematical interest, like integration by parts (useful as an exercise in how much fluidity you have in doing math and a good check you understand the concept).

Symbolic differential equations I'd cut down a lot. I think there's a sense in which they are useful but the utility is not revealed until a couple of semesters in. Even my college semester was frankly not that useful, you really need to dedicate yourself to them to get the value out of them. I'd put in some more work on numeric integration, and working with computers to get them done. The concepts of differential equations are super, super, super important; the exact knowledge of how to solve this super precise form of this exact differential equation is not. More practical experience to teach intuition, less grinding on symbolic details. The net time spent on them if I were writing the curriculum might even go up, because I'd tip in some (very) basic chaos mathematics here instead of all that grinding.

Matrices I'd have a hard think about. HN is at the epicenter of their utility so it might be hard to see that for most people it's not all that useful in any sense. I might like to move them on to a very explicitly STEM-focused track.

If that sounds horrible, remember that my whole point here is that there's a lot of stuff that should be in the curriculum that currently isn't, or is just glossed over very briefly. Like, I'd like more work spent on basic financial math, both for personal finances and doing things like a bit of running stochastic financial scenarios (integrate this into the stats curriculum, for instance). Which also brings up the idea of doing more simulations of somewhat larger statistical scenarios than you can solve as a closed form by doing Monte Carlo simulations; statistics and probability is very important but for most people it spins off into the symbolic weeds when in fact most problems people will have in real life are not cleanly amenable to such things. (This might also help erase the implicit belief that stats tends to teach that everything is uniformly distributed.)

The curriculum as it is is also structured as an unmotived series of solutions to problems the students don't have. I would try to give them the problems before the solutions; e.g., if I'm building a stats curriculum around simulations that go into symbolic math rather than just handing them symbolic math from the beginning, imagine covering the Central Limit Theorem from the point of view of me giving out a couple of different simulation assignments that all "happen" to converge to it despite very different scenarios, and we can discuss & teach why the seemingly totally different scenarios produced such a similar outcome, rather than just handing it down from On High as a Solution to a problem none of them have.

You can't have things like that if you aren't willing to cut something else because we are full up right now. There's a lot of room now for people to get more intuitive grasps of these things by virtue of working with them through practical numeric integration, Monte Carlo simulations, maybe we'll do a brief section on enough 3D geometry to do a useful introduction to 3D modelling/CAD/CNC/3D printing/the whole complex of modern tools available that use some form of 3D modelling, there's so much useful stuff that's just aching to be let in that the culling of the old needs to be a bit aggressive after a century.

To be honest I'd not cover this dimensionality stuff, except perhaps as a special-interest side day or something. It's not bad to do a few of those, just to expose students to the diversity in math. I got graph theory like that in my own high school, and it can stay that way; I wouldn't amp it up any. Dimensionality does pivot nicely into fractals and fractals have notoriously pretty pictures associated with them, so maybe I'd sneak it in with that.

aragilar 3 days ago | parent | next [-]

Are you talking high school or university maths? Australia had (and probably still has) financial and tax-based maths in high school (as well as intro stats).

jerf 3 days ago | parent [-]

High school, and even more particularly, the stuff we serve up to everyone, hence my reference to STEM-specific specialization for matrices.

In university you have the specialization to do as you need to do, e.g., serve up matrices to those who need them, serve up real analysis to those who need that, etc. And while HN is obviously fairly STEM-focused, a lot of majors in University won't get any math at all if you think about it, only just enough to have the fig leaf of a liberal education.

acoustics 3 days ago | parent | prev [-]

You've made me realize that I probably have a subconscious bias against science and engineering.

My view of the ideal math curriculum is very humanistic, focusing on the broad civic and intellectual value of formal reasoning, statistical fluency, etc. I never liked the in-the-weeds numerical stuff you get in science and engineering, but it's what the world is built on.

jerf 3 days ago | parent [-]

Despite my personal STEM focus I'd lean into that. I'm more interested in teaching mathematical modes of thought and some forms of mathematical intuition. I suspect grinding on symbolic computations is intrinsically necessary for that, but at the same time, I don't think it's sufficient, and that's what's missing from our curriculum right now. As evidenced by the people who come out of high school with all sorts of symbolic manipulation ability and still effectively no mathematical intuition or thought patterns to speak of. Then the symbolic manipulation abilities, unsupported by intuition or thought patterns, simply fade away with minimal impact on the person's life.

lordnacho 2 days ago | parent [-]

For me, the big takeaway that everyone cannot leave high school without is statistical critical thinking.

When you come across a meme with a graph, what should you say about it?

To me, that kind of thing comes before the stuff we think of as math. Calculus, matrices, geometry, all that stuff. People can learn those things if they are interested.

If they are bamboozled by bad statistics, society is finished.

cooljoseph 3 days ago | parent | prev [-]

> The system is full up at the moment and you can't really add anything without removing some things.

Middle school seems rather un-full to me. Right now students start learning about fractions in 4th grade. They don't move on to algebra until 9th grade. What is there in the middle? Not much, in my experience.

Maybe instead of having a giant no-math gap during middle school, they could move everything down and free up some space later on.

jerf 3 days ago | parent | next [-]

I doubt it. Local math programs tried to jam those things down sooner, but it doesn't do much good and may do harm. While I understand Piaget is not necessarily the last word in human development, using his terminology, real mathematical education can't really proceed until the formal operational stage is attained. Prior to that all you can really expect is extremely concrete things (in the aptly-named concrete operational stage) like arithmetic. Only single-digit percentages can handle simply moving that stuff earlier into the curriculum. The local conversation on that is distorted by HN having a lot of those single-digit percentages in question, but it's not the normal case.

While I didn't lay it out in my curriculum discussion, I also extremely, extremely strongly support using computers to provide personalized curricula to students designed to probe them for when they are ready to start more advanced math, leading to the complete destruction of the unbelievable awful cohort system in use today, and giving those single-digit percentages the ability to proceed onwards at their own pace, however much faster or slower it may be than anyone else's. But if my curriculum is goring a sacred cow, this idea is goring an entire herd of them at once. The field of education's resistance to computerization has been incredibly effective, to their personal benefit but to all our children's detriment.

OkayPhysicist a day ago | parent | prev | next [-]

Where the heck are they teaching algebra in 9th grade? Here in California that's 6th-7th grade curriculum.

aragilar 3 days ago | parent | prev [-]

Huh, Australia had (many years ago when I did it) algebra in year 7, and if you were in any kind of accelerated/gifted-and-talented class you'd see it even earlier.

tzury 4 days ago | parent | prev | next [-]

one of the most precious resources on the internet about dimensions is here

https://www.youtube.com/playlist?list=PL3C690048E1531DC7

walks you through step by step, builds the intuition and provides some historical context in the background.

despite "outdated" animation (15 years ago), still a great resource.

also available in 7 other languages.

xg15 4 days ago | parent | prev | next [-]

> Yet, this common-sense definition is unsatisfying if we consider that a lower-dimensional object might end up straddling a higher-dimensional space. If a line segment is rotated or bent, does that make it 2D? Or is that object forever one-dimensional, somehow retaining the memory of its original orientation and curvature?

Isn't that exactly what topological manifolds are for?

https://en.wikipedia.org/wiki/Manifold

codethief 4 days ago | parent | next [-]

For generic fractal curves the topology induced on the curve from the surrounding space will typically prevent that curve from being a topological manifold, since locally it won't look like R^n. It will merely be a topological space.

If, however, the (image of) the curve is a topological manifold (with the induced topology), then the (integer) dimension of the manifold will agree with the Minkowski dimension that's explained in the article (and also with the more commonly used Hausdorff dimension[0]).

[0]: https://en.m.wikipedia.org/wiki/Hausdorff_dimension

HelloNurse 4 days ago | parent | prev | next [-]

The article seems to miss the difference between just using low-dimensional manifolds (e.g. any line) and escalating to a higher-dimensional space to distinguish different ones (e.g. various lines in a plane).

jerf 4 days ago | parent [-]

I don't think it was "missed" so much as "the author chose not to discuss that". Just as it isn't productive to say that the Minkowski dimension, the main point of the article, "misses" that concept... it just isn't part of the definition. There are plenty of other mathematical ways to approach the situation but if you're always too busy talking about something else to talk about any particular concept you'll never get anywhere. Every article can't teach everything about any particular subject.

HelloNurse 3 days ago | parent [-]

But choosing not to discuss the obvious answer to a rhetorical question is a typical device of useless engagement bait posts on social media, hidden and made worse by the somewhat difficult subject. Ignorance is a much more charitable assumption than malicious waste of time.

dazzaji 4 days ago | parent | prev [-]

Not quite - as I understand it box-counting measures global space-filling, manifolds handle local coordinate structure. Consider that the Earth is locally flat but globally spherical, and a Möbius strip vs cylinder are locally identical but globally different. Related problems, but the tools reveal different aspects of geometry. So I think whether “this is exactly what topological manifolds are for” depends what you’re trying to understand.

Patryk27 4 days ago | parent | prev | next [-]

This was also covered by 3blue1brown, highly recommend: https://www.youtube.com/watch?v=gB9n2gHsHN4.

wodenokoto 4 days ago | parent | prev | next [-]

I'm not sure I understand how you can use a single number to say where on the Hilbert curve you are. As the curve is infintely, iteratively defined, you either can't say where you are on the curve, or you can say "length x, iterations y", which makes it 2 dimensional.

isoprophlex 4 days ago | parent | next [-]

If you take the length of the entire curve as a number l irrespective of the iteration depth, you can say you are at position 42% of l. Because at iter n, the segments are replaced by a new shape that does not grow beyond the bounds of the segments at n-1, the iterations are 'contractive', and iterating more deeply only makes the x, y location of 'i am at 42%' more precise.

arutar 4 days ago | parent | prev | next [-]

Here's another way that I like to think about it.

First, forget briefly about the Hilbert curve and just think about the unit square [0,1]^2.

If you take any point (x,y) in the unit square, we can associate x and y with binary coordinates, say x = 0.a1a2a3... and y = 0.b1b2b3... Then we can just define a new number z with binary representation 0.a1b1a2b2a3b3... And going the other way, given z in [0,1], we can take the 'even' binary coordinates to get x, and the 'odd' binary digits to get y.

The problem with this specific mapping is that the function is not continuous. But if you are a bit more careful:

1. The first digit says "left half vs right half"

2. The second digit says "top half vs bottom half" (of the rectangle from 1)

3. The third digit says "left half vs right half" (of the square from 2)

etc.

and then if two numbers share the first n binary digits (i.e. your points are close on the real line) then the corresponding points in the plane will also be quite close together (they are inside the same square / rectangle with side length like 2^(-n/2) at step n).

The "reason" why the dimension is different is precisely because of the "n/2": for every n digits of precision you have in the number z, you only get n/2 digits of precision for each of (x, y).

This is a bit imprecise because of issues with non-unique binary representation but (at least for me) it captures the spirit of why this should work!

jerf 4 days ago | parent | next [-]

You can write a fast algorithm to map distances to points on a Hilbert curve on a computer: https://stackoverflow.com/questions/499166/mapping-n-dimensi... It's complicated to just glance at, and the algorithm linked here does an arbitrary number of dimensions which also adds some complexity, but it's not that hard, all things considered. Despite the for loops, in practice it's a O(1) algorithm; if I'm reading the algorithm correctly it's technically O(number of bits in index + number of dimensions) but in practice both of those are fixed and the constant factors are very small and so for practical purposes it's going to be O(1) unless you're routinely dealing with highly variable index sizes and dimension counts in practice.

Thus this is a constructive proof that you can use easily convert Hilbert indices and coordinates back and forth between each other. Again, reading the algorithm I'm pretty sure if you give it the algorithm arbitrarily detailed numbers out to infinity, the obvious extension would "work" in that you can slap a "limit to infinity" on the algorithm in both cases and it would converge to any given point you like.

praptak 3 days ago | parent | prev [-]

The issues make it not continuous. The 1d limit of 0.01, 0.011, 0.0111, ... is 0.1

The 2d limit of the same series is the top right point of left half. The 2d representation of 0.1 is the bottom left point of the right half.

The Hilbert curve is mirrored and that's how it solves this problem.

praptak 4 days ago | parent | prev | next [-]

Yeah, it is not entirely obvious. You need to prove that if you fix a number x from range [0,1] then the point at "x * length(Hn)" converges to a point in 2D, for every x, as n goes to infinity (Hn = nth Hilbert curve).

The limit for x is the mapping from x to a point in 2D.

The proof is by observing that the subsequent "jumps" are exponentially smaller.

ComplexSystems 3 days ago | parent | prev [-]

You say lim y->inf (length x, iteration y).

desertrider12 3 days ago | parent | prev | next [-]

> the gaps are reduced to zero and the curve crosses through each and every point within its build envelope

I think that's oversimplifying an important point. If you build a Hilbert curve in a 1x1 square, the vertices of the curve always have rational coordinates. So all points on its line segments must always have at least one rational coordinate. There's no way it can cross through every point in a square region of R^2.

A better way to say it might be "the gaps are reduced towards zero and the curve will pass arbitrarily close by every point in its envelope". That still explains why its Minkowski dimension must be 2.

non_aligned 3 days ago | parent [-]

The limit of a process at infinity is not necessarily subject to the same constraints as the outcome you're seeing after a finite number of steps. The assumption you're making here is intuitive, but it bites students in the butt every now and then.

Most simply, after "infinitely many" steps, the "arbitrarily close" in your mental model becomes "infinitely close", and in real numbers, "infinitely close" is the same as "equal to", because you don't have infinitesimals.

It's the same reason why we can construct irrational or transcendental numbers as a limit of an infinite series of rational numbers.

desertrider12 3 days ago | parent [-]

Well, consider my ass bitten ;) Your analogy to infinite series helps.

pavel_lishin 4 days ago | parent | prev | next [-]

I wish this blog post had gone back to the cross-shape above, with mostly 1 degree of freedom, except in the center, and shown us what the logical dimensionality of it is.

arutar 4 days ago | parent | prev | next [-]

Once one exists the realm of differentiable manifolds, it is not really reasonable to talk about a single notion of 'dimension'.

Topological dimension is indeed something one can define: e.g. the Koch snowflake [1] or the graph of the Weierstrass function [2] have topological dimension 1. Actually, the first is homeomorphic to the unit circle and the second is homeomorphic to real line. It's great if you are doing topology and you only care about how things look like up to homeomorphism. But if you have metric structure (and you care about it), it is not so useful.

Minkowski dimension is certainly easy to define but it has some problems: sets which are "very small" (like a sequence `1/log(n)`) can have Minkowski dimension 1. The article has a minor technical oversight: the limit certainly does not need to exist. Minkowski defined it as the limit supremum of the sequence (actually, he defined it in terms of the decay rate of the size of the neighbourhood of the set, but this is equivalent). But one could analogously define a "lower" variant by taking the limit infimum instead.

Hausdorff dimension is not discussed in this article, but it is probably the most "robust" notion of dimension one can define. The Hausdorff dimension of any sequence is 0. But even then, lots of sets with Hausdorff dimension 1 can be very small, like the fat Cantor set which has dimension 1 but has length 0 [3]. So this 'dimension' does not necessarily line up with the intuition for "1-dimensional" in esoteric circumstances.

But even Hausdorff / Minkowski dimension does not capture the essence of some matters. For example, one might be interested in when a certain space can be mapped into another space without too much distortion (let's say by a map which respects the metric, like a bi-Lipschitz map). It can easily happen that a set has small (finite) Hausdorff or Minkowski dimension, but it cannot be embedded in a non-distorting way in any finite dimensional Euclidean space. This happens for instance with the real Heisenberg group [4]. If you are interested in this type problem then you want something like Assouad dimension [5].

The moral of the story is: the correct notion of dimension depends critically on what you want to do with your notion of 'dimension'. For sets which are very nice (smooth manifolds) all "reasonable" notions of dimension will coincide with what you expect; but beyond this there is an infinite zoo of ways to define dimension which are all reasonable in various ways, but capture genuinely different notions of 'size'.

[1]: https://en.wikipedia.org/wiki/Koch_snowflake

[2]: https://en.wikipedia.org/wiki/Weierstrass_function

[3]: https://en.wikipedia.org/wiki/Smith%E2%80%93Volterra%E2%80%9...

[4]: https://en.wikipedia.org/wiki/Heisenberg_group

[5]: https://en.wikipedia.org/wiki/Assouad_dimension

sans_souse 4 days ago | parent | prev | next [-]

Several.

swayvil 4 days ago | parent | prev | next [-]

Why do people disable zoom on their page?

magackame 4 days ago | parent [-]

Wdym? Can zoom just fine on desktop.

brettermeier 4 days ago | parent [-]

You cannot zoom on mobile. That really is lame.

robin_reala 4 days ago | parent | next [-]

I’d suggest it’s a problem with your browser that it respects the zoom restrictions, regardless of the page’s choices. Browsers are meant to be user agents – agents for the user – not agents for the page.

cvoss 4 days ago | parent | prev | next [-]

Firefox > Settings > Accesibility > Zoom on all websites.

Many browsers have similar settings.

omnicognate 4 days ago | parent | prev [-]

I'm on mobile (iOS Safari) and seem to be able to zoom fine.

bronlund 4 days ago | parent | prev [-]

A line has one dimension, and one only. It couldn't care less about whatever you do to it in higher dimensions. That's their problem.

bronlund 3 days ago | parent [-]

Why the downvotes? This is the correct answer to the first question raised: "...how many dimensions does a line have?".

You can track a point to create a line, you can shift the line to make a plane, you can move the plane to create a space, you can change the space to create time, you can observe time to create bliss, you can reflect on bliss to create thought, you can use thought to create an idea and you can use that idea to make a thingy.

You can create as many dimensions you like, all perpendicular to each other - one way or another. But I promise you this; even though the line is needed for the thingy, the line is blissfully unaware of this fact.

nh23423fefe 3 days ago | parent [-]

You seem to want to be "correct" instead of engaging with the article. Do you think Minkowski was ignorant?

bronlund 3 days ago | parent [-]

I'm not criticising Minkowski, I'm criticising the author of the article. He starts out by talking about one dimensional lines, then suddenly jumps to curves as if they could be mistaken for the same thing. And in my humble opinion, it goes downhill from there. He even manage to talk about one dimensional squiggles which is an oxymoron. In one dimension, nothing is squiggly - that is an effect of higher dimensions.

That being said, I don't care much for Einstein's relativity or the derived works either. I think Maxwell was on to something and that quantum mechanics more or less agrees with him.