You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very interesting question. Simple in terms of it being a greedy heap question, but facinating in terms of how it highlights how ratios change as you augment them.
2
+
3
+
I initially assumed that we'd simply be adding to the class that's denominator was the smallest since it'd have the largest ratio effect since smaller ratios are more sensitive.
4
+
5
+
I then thought that for ratios with equal denominators, you should apply it to the case with a smaller numerator since the larger case is more "stable" and would "gain" less since its existing numerator amount would "decrease" a more since the increased denominator also affects it.
6
+
7
+
Then I realized that this isn't always true so I adjusted the heap to be based on a precomputed heuristic that is the benefit of adding a excelling student to the given class directly. I'm curious as to the math and logical reasoning that causes this though! Will keep digging :D
0 commit comments