Internalizing math using programming?

  • Context: Studying 
  • Thread starter Thread starter sbrothy
  • Start date Start date
  • Tags Tags
    Programming
Click For Summary

Discussion Overview

The discussion revolves around the idea of internalizing mathematical concepts through programming, particularly in the context of game development and computer graphics. Participants explore the relationship between programming and mathematics, share personal experiences, and consider the challenges of learning math in a programming environment.

Discussion Character

  • Exploratory
  • Conceptual clarification
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant reflects on their background in programming and expresses a desire to learn more mathematics through practical applications in programming, specifically mentioning a book on 3D game programming.
  • Another participant notes that while programming and mathematics share some skills, they represent fundamentally different ways of thinking, suggesting that programming may not fully capture the depth of mathematical understanding.
  • A participant shares their experience with the Mandelbrot Set and suggests extending programming exercises to include fractals for 3D settings, indicating a blend of creativity and mathematical exploration.
  • Concerns are raised about the ease of programming with new features in C++ that may reduce the need to engage deeply with mathematical concepts, leading to a feeling of stagnation in learning.
  • One participant expresses a desire to return to foundational concepts in mathematics, specifically mentioning a book on set theory and logic, and seeks recommendations for more current resources.
  • A participant inquires about the appropriateness of sharing their attempts at solving exercises, indicating a willingness to engage with the community for feedback and support in their learning journey.

Areas of Agreement / Disagreement

Participants express a mix of agreement on the value of programming for learning mathematics, but also highlight significant differences in thought processes between the two disciplines. There is no consensus on the best approach to internalizing math through programming, and the discussion remains open-ended regarding the effectiveness of this method.

Contextual Notes

Participants acknowledge the limitations of programming as a sole method for learning mathematics, emphasizing the importance of engaging with mathematical problems through traditional methods as well. There are references to specific programming features that may impact the learning process, but no resolution on their implications is reached.

Who May Find This Useful

This discussion may be of interest to individuals looking to enhance their mathematical understanding through programming, educators exploring innovative teaching methods, and those considering the intersection of coding and mathematical concepts in practical applications.

sbrothy
Gold Member
Messages
1,465
Reaction score
1,333
I know this isn't really asking for advice but maybe someone has a comment or two...

As a young(er) man, while many of my friends fooled around doing drugs and (other) mindless entertainment, I was enough of a nerd to want to learn programming. Of course, I didn't spend my entire youth in front of a screen but, the result is that, today, I'm pretty adept at coding (if I should say so myself and obviously I shall). :) I may be a little "out of the loop" because I haven't used it professionally in ages, but it's a little like riding a bicycle: your skills may deterioate but you don't quite forget altogether. Mathematics is a lot like that. You may read and perhaps even understand intellctually / abstractly, but without solving problems and getting your "hands dirty" true understanding just won't come. Lots of thing are like that of course. Painting, skating, playing an instrument etc...

Programming requires - needless to say - a certain amount of logical and mathematical ability, which I picked up too. I did go to school(!) but never attended college. Partly because my autodidact abilities enabled me to make quite a lot of money back in the day and partly because of certain force majeure events which has left me partially disabled.

I am now retired, on a disability pension which, because I live in Denmark, is actually sufficient to support a moderately comfortable life (particularly compared to what I see poor people in other countries having to contend with). I kinda regret I didn't use that time learning mathematics instead, but obviously, considering my situation, it's not too late. Alhough learning is undeniably easier when you're young.

So where am I going with this rant?tl;dr:

I had the "excellent" idea that I'd try to learn more math by doing it in context of programming. I once wrote a Mandelbrot application where I rolled my own class for complex numbers. Not that there wasn't a math API but out of interest. To me programming is a lot like playing with LEGO for grownups. So I thought I'd do the same with vectors, matrices , quaternions etc. I should be able to internalize, if not everything, then at least a good bit of it. Especially seeing as 3D game programming makes use of all these concepts. I'm starting with this one:

"Mathematics for 3D Game Programming and Computer Graphics (3rd Ed.) "
---- Erik Lengyel
 
Last edited:
Physics news on Phys.org
When most Mathematicians think about Math, it's quite a bit more than what you are likely to lead yourself into by programming a computer. And the skills for being a good Mathematician and a good Coder certainly have some overlap - but really it's a fundamentally different way of thinking. Perhaps this will change when we need to start coding qubits.

In the case of the Mandelbrot Set, it plays into programming very nicely. I've coded that up myself and even have a favorite way for adding in colors. That "3D Game Programming & CG" sounds interesting. Perhaps you can extend your Mandelbrot exercise into fractals appropriate for your 3D game settings. You could create settings with infinite detail.
 
  • Like
Likes   Reactions: sbrothy
.Scott said:
When most Mathematicians think about Math, it's quite a bit more than what you are likely to lead yourself into by programming a computer. And the skills for being a good Mathematician and a good Coder certainly have some overlap - but really it's a fundamentally different way of thinking. Perhaps this will change when we need to start coding qubits.

In the case of the Mandelbrot Set, it plays into programming very nicely. I've coded that up myself and even have a favorite way for adding in colors. That "3D Game Programming & CG" sounds interesting. Perhaps you can extend your Mandelbrot exercise into fractals appropriate for your 3D game settings. You could create settings with infinite detail.

I know it's not the same as sitting down and solving problems with pen and paper. I'm just a little lazy and like playing with C++. :)

I know that to really get the grips with the real thing I need to commit it to "muscle memory" . Which reminds me:

https://www.amazon.com/dp/0521794625/?tag=pfamazon01-20
 
  • Like
Likes   Reactions: .Scott
So much for that "excellent" idea. It would seem that the operative words in my tirade above are internalize and out of the loop.

It seems that from C++ 20 onwards I don't even have to write the math operators. They're all provided by the compiler once you've written the "spaceship" (three-way comparison) operator". And even "writing" that is a stretch as it looks, for internal types (like float and double, ie. those that come closest to real numbers), like this:


auto operator<=>(const SomeObject&) = default;
---https://devblogs.microsoft.com/cppblog/simplify-your-code-with-rocket-science-c20s-spaceship-operator/

Now, this is applicable "only" to totally ordered binary sets (https://en.m.wikipedia.org/wiki/Total_order) but it does make it a little bland. Easier for sure but who'll learn anything from that?

It seems math itself is conspiring to make my life harder by making programming easier, and I know that doesn't make much sense.

I may have aimed a little high. I think I would benefit of going back to basics. I better start with learning about sets. So pen and paper it is! :)
 
Last edited:
sbrothy said:
So much for that "excellent" idea. It would seem that the operative words in my tirade above are internalize and out of the loop.

It seems that from C++ 20 onwards I don't even have to write the math operators. They're all provided by the compiler once you've written the "spaceship" (three-way comparison) operator". And even "writing" that is a stretch as it looks, for internal types (like float and double, ie. those that come closest to real numbers), like this:


auto operator<=>(const SomeObject&) = default;
---https://devblogs.microsoft.com/cppblog/simplify-your-code-with-rocket-science-c20s-spaceship-operator/

Now, this is applicable "only" to totally ordered binary sets (https://en.m.wikipedia.org/wiki/Total_order) but it does make it a little bland. Easier for sure but who'll learn anything from that?

It seems math itself is conspiring to make my life harder by making programming easier, and I know that doesn't make much sense.

I may have aimed a little high. I think I would benefit of going back to basics. I better start with learning about sets. So pen and paper it is! :)

So, I procured

"Set Theory and Logic (1961-62) by Robert R Stohl,

which seems to have excercises within my grasp. At least at the beginning. The book is atmiddedly kinda dated so perhaps someone can recommended a newer one?

Incidentally, would it be OK, and within one of the forum's guidelines, for me to post my first few attemps at solving the very first excises? I' sure that most of the home work helpers and teachers here have other things do to than be my pesonal teacher, and I will gladly enroll in a proper course if I find this stuff isn't way over my head. A couple of quick "gradings" of my first "work" would tell me if this a subject I have chance of persuing with at least minimum succes. The difficultly level would make your task of checking my results pretty trivial I suspect. :)

EDIT: OK, I've found a couple of more books but although they're newer there's really not much difference. Not even in presentation. Then again I guess there's only so many ways you can present this subject. Ironically, I'm aware that this is the subject presented to the first math levels in elemental school. (Which is kinda doubly ironic as it's a a part of abstract algebra right? Presuambly because of it's seemingly self-evident truth. Although I'm sure there are several paradoxical and nasty pitfalls in there. :)
 
Last edited:
sbrothy said:
Incidentally, would it be OK, and within one of the forum's guidelines, for me to post my first few attemps at solving the very first excises? I' sure that most of the home work helpers and teachers here have other things do to than be my pesonal teacher, and I will gladly enroll in a proper course if I find this stuff isn't way over my head.
Sure, go ahead and post away.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
5K
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K