Internalizing math using programming?

  • Studying
  • Thread starter sbrothy
  • Start date
  • Tags
    Programming
In summary: I don't know if I should be disappointed or relieved. In summary, this retired programmer thinks that it might be a good idea to learn more math so he can better code for 3D games. However, he is concerned that he may not be good enough at it and may not be able to internalize it.
  • #1
sbrothy
Gold Member
446
342
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
  • #2
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 sbrothy
  • #3
.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 .Scott
  • #4
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:
  • #5
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:
  • #6
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.
 

1. How can programming help with internalizing math concepts?

Programming allows for hands-on practice and application of mathematical concepts, making it easier to understand and internalize them. Additionally, programming helps with problem-solving skills and logical thinking, which are essential for understanding math.

2. What are some programming languages that are useful for internalizing math?

Some popular programming languages for math include Python, Java, and C++. These languages have built-in math functions and libraries that make it easier to work with mathematical concepts.

3. Can programming be used for all levels of math?

Yes, programming can be used for all levels of math, from basic arithmetic to advanced calculus and beyond. It can also be used for a wide range of mathematical applications, such as data analysis, simulations, and modeling.

4. Do I need to be good at math to learn programming?

While having a strong foundation in math can be helpful for learning programming, it is not a requirement. Programming is a skill that can be learned and improved upon with practice, and it can also help improve math skills through hands-on application.

5. How can I get started with using programming to internalize math?

The best way to get started is by choosing a programming language and finding resources, such as online tutorials or books, to learn the basics. Then, start practicing by writing simple programs that involve mathematical concepts. As you become more comfortable, you can move on to more complex projects.

Similar threads

Replies
6
Views
962
  • STEM Academic Advising
Replies
16
Views
413
Replies
2
Views
881
Replies
6
Views
933
  • STEM Academic Advising
Replies
3
Views
440
  • STEM Academic Advising
Replies
2
Views
1K
  • STEM Academic Advising
Replies
9
Views
1K
  • STEM Academic Advising
2
Replies
63
Views
5K
Replies
115
Views
7K
  • STEM Academic Advising
Replies
16
Views
866
Back
Top