Sorry, I know this is an incredibly dense question, but I am struggling big time here and I don't know what else really to do at this point aside from hiring a person smarter than me to tackle this issue.
So I am creating a game that, at its core, is a 1v1 game of Liar's Dice. For those who need an explaination, two players shake up 5 six sided die in a cup and place them on a table, hidden from each other's view. You may view your own hand, but you may not see the other player's hand. The starting player then wagers how many total dice are presenting a certain pip on the entire table. A wager of "Three 2s" would be claiming "There are at least three dice showing the 2-pip side".
The next player then must either raise the wager, either by raising the number of wagered dice (Four 2s) or pips (Three 3s), or they may call the other player a Liar to reveal all hands on the table. If the player who calls is correct, then the liar loses a die. If the player who calls is incorrect, then the caller loses a die.
Play continues until one player loses all of their dice.
In this game, 1s count as wilds, meaning they represent any face. So a hand of 1, 1, 2, 3, 4 could call "three 3s" in absolute safety since the 1s represent the remaining 3s.
So here's where I am getting stuck: every article that explains the math of this game just boggles my mind and I have no idea how to break this concept down. I am unsure how to program an AI for the enemy player if I can't understand the probability of the game itself. I struggled with high school math. I struggled with using Pi to calculate the tiles to be exploded in a fighting game I made two years ago.
I have the player's hand loading into an array and the enemy hand loading into an array. I also have the enemy hand loading into a special array called "known dice" since the enemy player will cheat during the game to gain information they shouldn't normally have, but that's another day's problem for now, although I assume if I build this AI to work off of the "known dice" array now, then it will still work later when I add cheating.
So Wikipedia breaks it down as "The expected quantity of any face value among a number of unknown dice is one-sixth the total unknown dice. A bid of the expected quantity (or twice the expected value when playing with wilds), rounded down, has a greater than 50% chance of being correct and the highest chance of being exactly correct."
So this means first I have to take the number of unknown dice and divide it by 6. Then I take the result and double it, then round it down, and this will give a resut of a "probably true" bid if I include the known dice? Basically I need to create a conditional tree for how many unknown dice there are on the table, do that piece of math, and then compare it to what the player has claimed and go from there.... I think?
Many of these articles are going into these massive formulas that I just can't wrap my head around. This one is basically Latin to me.
Can anyone offer me some assistance here?