title: Guess-Who? Best Algorithm
body: <p>I'm making a program that imitates the guess-who game where questions are asked in order to determine who the secret person is.</p>
  
  <p>I'm just kind of stuck on how to categorize my questions in a way that it will be the most efficient, the characters have 6 different attributes, Shirt, Hair, Eye, Smiling, Hair, Glasses.</p>
  
  <p><img src="https://i.stack.imgur.com/Y84dE.png" alt="enter image description here"></p>
  
  <p>I already wrote a program to this but my decision tree was so inefficient that it asked around 10-30 questions. My aim is to find an algorithm thats between 6-10 questions.</p>
  
  <p>If it helps I'll provide the my old tree to show you what I'm talking about but I'm gonna make a new one based on what you guys think.</p>
  
  <pre><code>if (g.hairIsColor(Color.BROWN) &amp;&amp; g.eyeIsColor(Color.HAZEL) &amp;&amp;
      g.isSmiling() &amp;&amp; g.shirtIsColor(Color.GREEN) &amp;&amp;
      g.isWearingGlasses())
      a = "Emily";
  
  if (g.hairIsColor(Color.BROWN) &amp;&amp; g.shirtIsColor(Color.GREEN)) {
      if (g.eyeIsColor(Color.BLUE))
          a = "Alice";
      else if (g.eyeIsColor(Color.GREEN))
          a = "Frank";
      else if (g.eyeIsColor(Color.BROWN) &amp;&amp; g.isWearingGlasses())
          a = "Bob";
      else if (g.eyeIsColor(Color.BROWN))
          a = "Dave"; // this might be an error for other brown hair
      else
          a = "Isabelle";
  }
  // NULL IT WAS EMILY FALSE
  
  else if (g.hairIsColor(Color.BROWN) &amp;&amp; g.shirtIsColor(Color.RED)) {
      if (g.eyeIsColor(Color.GREEN))
          a = "Philip";
      else if (g.eyeIsColor(Color.BLUE) &amp;&amp; !g.isSmiling())
          a = "Wendy";
      else if (g.eyeIsColor(Color.BLUE) &amp;&amp; g.isWearingGlasses()) 
          a = "Mallie";
      else if (g.eyeIsColor(Color.BLUE))
          a = "Nick";
      else if (g.eyeIsColor(Color.BROWN) &amp;&amp; g.isWearingHat())
          a = "Robert";
      else if (g.eyeIsColor(Color.BROWN) &amp;&amp; g.isSmiling())
          a = "Quinn";
  }
  
  
  
  else if (g.hairIsColor(Color.BLACK) &amp;&amp; g.shirtIsColor(Color.BLUE)) {
      if (!g.isSmiling())
          a = "Carol";
      else if (g.isWearingHat())
          a = "Gertrude";
      else
          a = "Olivia";
  }
  
  
  else if (g.hairIsColor(Color.BROWN) &amp;&amp; g.eyeIsColor(Color.BLUE))
      a = "Tucker";
  
  else if (g.hairIsColor(Color.BROWN) &amp;&amp; g.eyeIsColor(Color.BROWN))
      a = "Zander";
  
  else if (g.hairIsColor(Color.BLOND) &amp;&amp; g.shirtIsColor(Color.RED))
      a = "Henry";
  
  else if (g.hairIsColor(Color.BLOND) &amp;&amp; g.shirtIsColor(Color.BLUE))
      a = "Jack";
  
  else if (g.hairIsColor(Color.BLACK) &amp;&amp; g.eyeIsColor(Color.HAZEL))
      a = "Karen";
  
  else if (g.hairIsColor(Color.BLACK) &amp;&amp; g.isWearingHat())
      a = "Xavier";
  
  else if (g.hairIsColor(Color.BLACK))
      a = "Ursula";
  
  else if (g.hairIsColor(Color.RED) &amp;&amp; g.shirtIsColor(Color.GREEN))
      a = "Yasmine";
  
  else if (g.eyeIsColor(Color.BLUE))
      a = "Larry";
  
  else if (g.isWearingHat())
      a = "Sarah";
  
  else if (g.isSmiling())
      a = "Victor";
  
  return a;
  </code></pre>