Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Nice question, and I like your idea for statistical approach. <br>I think I would have tried a <a href="http://en.wikipedia.org/wiki/Supervised_learning" rel="nofollow">machine learning</a> approach for this problem as follows:</p> <p>First model your problem as a <a href="http://en.wikipedia.org/wiki/Statistical_classification" rel="nofollow">classification problem</a>. <br>The classification problem is: Given a square <code>(x,y)</code> - you want to tell the likelihood of having a ship in this square. Let this likelihood be <code>p</code>.</p> <p>Next, you need to develop some 'features'. You can take the surrounding of <code>(x,y)</code> [as you might have partial knowledge on it] as your features.</p> <p>For example, the features of the middle of the following mini-board (+ indicates the square you want to determine if there is a ship or not in):</p> <pre><code>OO* O+* ?O? </code></pre> <p>can be something like:</p> <pre><code>f1 = (0,0) = false f2 = (0,1) = false f3 = (0,2) = true f4 = (1,0) = false **note skipping (1,1) f5 = (1,2) = true f6 = (2,0) = unknown f7 = (2,1) = false f8 = (2,2) = unknown </code></pre> <p>I'd implement features relative to the point of origin (in this case - <code>(1,1)</code>) and not as absolute location on board (so the square up to <code>(3,3)</code> will also be f2).</p> <p>Now, create a training set. The training set is a 'labeled' set of features - based on some real boards. You can create it manually (create a lot of boards), automatically by a random generator of placements, or by some other data you can gather.</p> <p>Feed the training set to a learning algorithm. The algorithm should be able to handle 'unknowns' and be able to give probability of "true" and not only a boolean answer. I think a variation of <a href="https://en.wikipedia.org/wiki/Naive_Bayes_classifier" rel="nofollow">Naive Bayes</a> can fit well here.</p> <p>After you have got a classifier - exploit it with your AI. <br>When it's your turn, choose to fire upon a square which has the maximal value of <code>p</code>. At first, the shots will be kinda random - but with more shots you fire, you will have more information on the board, and the AI will exploit it for better predictions.</p> <hr> <p>Note that I gave features based on a square of size 1. You can of course choose any <code>k</code> and find features on this bigger square - it will give you more features, but each might be less informative. There is no rule of thumb which will be better - and it should be tested.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload