alexirpan
alexirpan on Hacker News
It's not a typo - specifically the time complexity is O(n^2
2^n2^n) = O(n^24^n). This is faster than your O(N!
N!) proposal.https://www.wolframalpha.com/input?i=plot+%28n%21%29%5E2+vs+...
To be more specific - you get to O(n^22^n*2^n) by doing dynamic programming, which lets you avoid recomputing extra work for considering future ordering possibilities. This approach still implicitly considers all possible future orderings and acts optimally with respect to that.
You can read the original post for more details - at a high level you are building a cache of win probabilities assuming optimal play, starting from the base case of 1-player crew battles, and extending it by 1 match per step of the recursion until you get back to the top-level problem. It is sufficient to only do computation 1 step ahead if you have a cache for how to act optimally for all n future steps.
You can actually do better than O((N!)^2), you can get it in O(n^24^n) because you can reduce the state to finding the next best single player to send in given the unordered set of unused players.
Source: the part of the post literally a few paragraphs down from the quoted section, where I describe how to do this, acknowledge this is fast enough to brute force for real crew battles that run with small N, and then write code to do so ;)
Author here. My intent was to say, "When someone I know asks me if RL is a good idea, the answer is no >= 70% of the time." The important missing piece is that it's conditioned on that person asking me in particular. I don't have the largest profile, so the people who ask me about RL are generally well-informed about RL and have some practical ML experience too. Within that set, 70% felt like the right lower bound.
Posted by
alexirpan on Friday February 12, 2016 @03:14PM
from the alexirpan.com dept.
Posted by
alexirpan on Tuesday January 12, 2016 @01:38PM
from the alexirpan.com dept.
Posted by
alexirpan on Monday January 11, 2016 @06:48PM
from the alexirpan.com dept.