For a start, if you're dealing with humans, forget the idea of starting in any random or binary manner. For numbers between 1 and 10, make 7 your first guess.
Weird as it may seem, at least in some cultures, given the 1 to 10 choice, as many as 60% or more will choose 7! In other words, your most efficient algorithm is not a random one.
It probably does you no great harm, if you then follow various binary search techniques from that point onward, although this (http://groups.csail.mit.edu/uid/deneme/?p=628) would suggest you have better strategies to continue with past your hard-coded first choice.
This is not a "pure maths" solution -- it's about real life, so you'd better prepare your groundwork if your professor wants you to play with abstract theory rather than the Real World. Cite the above as a reference or google for more examples ?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.