Hacker News new | past | comments | ask | show | jobs | submit login

For 1000 possible combinations, wouldn't you expect to have to try ~500 combinations on average to find solutions? Since you found it in 800 attempts, this suggests that whatever method you used may have actually made your odds of success worst.



> on average

You can "expect" but if you only have one lock to unlock, it can be anything from 1 to 1000 attempts.

If you had 1000 locks, you can expect that the average would be 500 (if the numbers were truly random), but it still means that you might need one try for some locks, and 999 tries for some other lock.


Well if you enumerate in order and your code is 800 then you have to try 800 cases.


I'm not sure how you make that inference. Could you explain your logic?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: