[Official] Assignment 3

Disclaimer: Dieser Thread wurde aus dem alten Forum importiert. Daher werden eventuell nicht alle Formatierungen richtig angezeigt. Der ursprüngliche Thread beginnt im zweiten Post dieses Threads.

[Official] Assignment 3
I’ve published assignment 3 at https://kwarc.info/teaching/AI/assignment.pdf

Prior assignments and solutions are at https://kwarc.info/teaching/AI/assignments.pdf


I can neither see the new assignment, nor the solutions. Is this an issue on my side or on yours?

Update: I can see the updated files now. :slight_smile:

1 „Gefällt mir“

There seems to be no comment on how the minimax predicate should look like. Does that mean that we can decide how to implement it by ourselves?


(Quelle: Two Hard Things)


I am having a similar question: What should the minimax predicate output? Should it just write one line to the console (“the next move is: take 2”). Or should it play the entire game (max and min until one wins) and print this to the console? Or should it return something as a second argument?

And: What input numbers should the program be able to handle? I can compute miniMax(23), but for miniMax(24), I am getting a “Stack limit exceeded” error.

1 „Gefällt mir“

Thanks for asking, i have the same problem. :slight_smile:

My idea was to apply minimax not before a certain amount of matches, for example 16 or something… and before that, we choose a random (or always static) amount of matches to take next, but let’s see what the official answer will be :slight_smile:


If the algorithm works in principle, don’t bother about resource limits. It is in the nature of minimax that it explodes beyond feasibility when the search tree becomes too big.

1 „Gefällt mir“

I imagined just returning who will win.

But outputting the recommended next move is a good extension. It’s not difficult to do and can help a lot with testing.

Outputting the entire game (i.e., a path where both players play optimally), but also not that hard to do and can also help with debugging.

A3.3: What move to make if there is no winning move?
Someone asked in the tutorial what to do if there is no winning move.

minimax does not care about whether a move wins or loses. It considers all options and chooses one with minimal resp. maximal value. If there are multiple moves with extreme value, it chooses any one of them.

So for example, in a losing position all moves might have value -infinity. Then minimax picks any one of those.


Perfect, thank you for the explanations! :slight_smile:

Solutions posted
At the usual place


Problem 3.3:
Why do we get minus points for not giving an example invocations? There is no mention of a example in the task description. I don’t think that’s fair.


I’ve checked with the grading tutor.

The deductions were for general difficulty in understanding what the program does, e.g., being unable to find the entry point due to the lack of an example or documentation.

That is acceptable and supported by the general remarks on Assignment sheet 1.