8 ms·
I used to do some "competitive programming" back in university - which I think helped me grasp quite a few Mathematics concepts.
by irajdeep 3y ago
I used to do some "competitive programming" back in university - which I think helped me grasp quite a few Mathematics concepts.
- madsbuch 3y agoWhich mathematical concepts would you say that you got to grasp? Having done competitive programming also, I would not say that it made any difference for my mathematical perception.
- irajdeep 3y agoTo 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.
- madsbuch 3y agoHow 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.
- bombolo 3y ago> Even using recursion is rarely a good idea as you loose control with your memory layout. Functional programming? NOT TODAY!
- madsbuch 3y agoIt seems like Java and Python are only just starting to get a place in COMPETETIVE programming :) I definitely think we will have to wait before we get stuff like Haskell or Idris in there.
- irajdeep 3y ago> 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")
- madsbuch 3y agoI 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.