Show HN: Solving JEE Advanced Problems Using Python – Exploring Binomial Theorem

1 pointsposted 9 months ago
by animeshchouhan

4 Comments

zahlman

9 months ago

This presentation seems bizarre to me. It introduces the binomial theorem, then proposes an implementation of `coeff` that doesn't require knowledge of such, then introduces `math.comb`... but then it never gets around to re-implementing `coeff` by using `math.comb` and taking advantage of the binomial theorem.

Applying computational brute force to this kind of contest problem is missing the point, too. Project Euler problems are specifically designed for a code-driven approach anyway. Writing code like this for the problem shown doesn't really teach anything interesting about math, while the programming exercise it motivates is a fairly dull one.

Finally: the JEE is specific to India and you shouldn't expect an international audience to have heard of it - especially since it's a college entrance assessment, not a contest.

All that said, the code is well presented and laid out in a logical order (as far as it goes), and I appreciate the commitment to LaTeX (I use NoScript and only allow scripts when a clear need presents itself; I don't mind reading LaTeX syntax).

animeshchouhan

9 months ago

Thank you so much for the constructive feedback!

> This presentation seems bizarre...

My thought process was setting the context of how the problem would be solved by pen/paper and implementing a recursive solution if you didn't know binomial theorem beforehand. It is trivial to implement coeff using math.comb so skipped that part.

> Applying computational brute force...

That's the fun part at least for me, modeling problems not meant to be solved programmatically and solving them anyways.

> Finally: the JEE is specific to India...

Yeah true that, should have given a better context

Actually, I am just starting with writing blogs, so trying various avenues. Thanks again for the feedback. Will work on improvements.

zahlman

9 months ago

Good luck!

I'm probably not at all in your intended audience, so don't take it too seriously. But I do think it's a good idea to "close the loop" when you're presenting ideas around a central theme (here, combinatorics). There's a lot more you could add from here, too, branching off into why `math.comb` gives the right answer. That is, if you present a way to do something without the binomial theorem, but also talk about how the binomial theorem is relevant and would allow solving the problem, the natural completion is to... prove the theorem :) (Or at least, cite someone else's proof.)

user

9 months ago

[deleted]