Well if the ai had a static memory of all the cards in his deck and was aware of the amount of cards on the field in his hand and in his graveyard, He could comtemplate the chance of him getting a certain card , But also if the AI new the opponents deck too then it could count cards in his hand deck and graveyard to see the chance of his actions being countered.He would then play according to the way that gave the highest win chance at that time.