# Applying minimax tree to this array [closed]

Please tell me how I should apply minimax algorithm to the array $$15, 12, 14, 16, 11, 13$$ and make a tree?(I understand how minimax algorithm works but I can't apply it to an array)

## closed as unclear what you're asking by Evil, Discrete lizard♦, Apass.Jack, xskxzr, David RicherbyJan 15 at 15:12

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• What have you tried so far? Could you transcribe image into text? Could you give more context to your question? – Evil Jan 14 at 21:26
• As I mentioned I know how minimax algorithm works but I can't do anything when it comes to an array ! Please tell me how I should make a minimax tree with this array. – armin ariana Jan 15 at 6:42
• Or maybe you do not understand how minimax works... You actually need two dimensions to apply a minimax. You first compute all minimums along a dimension and then take the maximum of these minimums. – Vince Jan 15 at 9:06
• @Vince Could you please provide a text or picture so that I can see exactly what is going on? – armin ariana Jan 15 at 9:15
• What do you mean by "minimax algorithm"? The most famous algorithm with that name is used to choose an optimal move from a game tree clearly doesn't apply to arrays. So what algorithm are you talking about? Also, note that an algorithm is literally an explicit set of steps to perform some task so, if you understand the algorithm, there's nothing to do: just apply the steps, like an unthinking robot. – David Richerby Jan 15 at 15:12

Minimax is actually applied on a 2D matrix like:

3  5  6  13  8
7  9  2  4   6
4  12 15 16  10


Generally, you have a choice to do, let say it corresponds to one of the columns in the exemple (5 choices). And there is an unpredictable choice (random, opponent choice ...), the row in the example (3 choices). Minimax minimizes the risks by assuming this unpredictable choice will be the worst for you.

In the example, you first compute the minimum on all colums:

3 5 2 4 6


So you finally pick the 5th choice, which guarantees at least 6.

In your problem you have 1 dimension, then minimax has no sense on it. Or you can degenerate it saying there is no unpredictable variable and just pick the maximum.