Re:A Programmer's Introduction to Mathematics
by irajdeep on Wednesday May 03, 2023 @09:52AM
(#35802408)
To name a few concepts: "Permutation & Combination", "Proofs with induction", "Probability". I did learn some of them from university courses, but writing code for them(in terms of coding problems) helped cement few of the them for me.
[ Parent
| on HN ]
Re:A Programmer's Introduction to Mathematics
by madsbuch on Wednesday May 03, 2023 @10:17AM
(#35802681)
How did you apply induction proofs in competitive programming?
Even using recursion is rarely a good idea as you loose control with your memory layout.
And using a language that supports the concept of proof by induction would surely leave you on the absolutely last place for competitive programming as most of the algorithms used use guarantees that are extremely difficult to reason about even with some of the most recent advances in formal methods.
I do see how combinatorics work with competitive programming, though. and to an extend also probability theory, though I never used any probabilistic algorithms myself.
Re:A Programmer's Introduction to Mathematics
by irajdeep on Wednesday May 03, 2023 @10:25AM
(#35802792)
> Even using recursion is rarely a good idea as you loose control with your memory layout.
Used recursion at tons of Codeforces / ICPC problems with some caching(commonly known as "dynamic programming")
Re:A Programmer's Introduction to Mathematics
by madsbuch on Wednesday May 03, 2023 @10:31AM
(#35802859)
I think most problem sets would be hard to solve without use of dynamic programming, irrespective of recursion or not. But yes, recursion with memorisation/accumulation would be a good place to start.
Re:A Programmer's Introduction to Mathematics
by bombolo on Wednesday May 03, 2023 @11:41AM
(#35803746)
> Even using recursion is rarely a good idea as you loose control with your memory layout.
Functional programming? NOT TODAY!