Studying Internalizing math using programming?

  • Thread starter Thread starter sbrothy
  • Start date Start date
  • Tags Tags
    Programming
AI Thread Summary
The discussion centers on a retired individual reflecting on their journey in programming and mathematics. They express a desire to deepen their understanding of math through programming, particularly in the context of 3D game development. They mention past experiences with coding, including creating a Mandelbrot application, and recognize the overlap between programming and mathematical thinking, while also noting the distinct differences in approach. The individual acknowledges a need to return to foundational math concepts, specifically set theory, and has acquired a book on the subject. They seek feedback on their attempts at solving exercises and inquire about the appropriateness of sharing their work in the forum, indicating a willingness to engage with the community for guidance. The conversation highlights the challenges of learning math in a practical context and the evolving nature of programming languages, particularly with new features in C++20 that simplify coding but may hinder deeper learning.
sbrothy
Gold Member
Messages
1,145
Reaction score
1,040
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 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 .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.
 
After a year of thought, I decided to adjust my ratio for applying the US/EU(+UK) schools. I mostly focused on the US schools before, but things are getting complex and I found out that Europe is also a good place to study. I found some institutes that have professors with similar interests. But gaining the information is much harder than US schools (like you have to contact professors in advance etc). For your information, I have B.S. in engineering (low GPA: 3.2/4.0) in Asia - one SCI...
Bit Britain-specific but I was wondering, what's the best path to take for A-Levels out of the following (I know Y10 seems a bit early to be thinking about A-levels, but my choice will impact what I do this year/ in y11) I (almost) definitely want to do physics at University - so keep that in mind... The subjects that I'm almost definitely going to take are Maths, Further Maths and Physics, and I'm taking a fast track programme which means that I'll be taking AS computer science at the end...
I graduated with a BSc in Physics in 2020. Since there were limited opportunities in my country (mostly teaching), I decided to improve my programming skills and began working in IT, first as a software engineer and later as a quality assurance engineer, where I’ve now spent about 3 years. While this career path has provided financial stability, I’ve realized that my excitement and passion aren’t really there, unlike what I felt when studying or doing research in physics. Working in IT...
Back
Top