In a recent election for class president, Monika received 7 of the 10 votes and Alfred received 3 of the 10 votes that were cast by the class.

When the machine was counting the votes, it malfunctioned and instead of giving the vote to the correct person,
it gave the vote to each candidate with probability 12 (regardless of whom the vote was cast for).
The probability that the machine gave each student the correct number of votes in the election can be expressed as a/b where a and b are positive, coprime integers.
What is the value of a+b?

To find the probability that the machine gave each student the correct number of votes, we need to consider the possible outcomes of the malfunctioning machine.

Let's define the events:
A: Monika receives the correct number of votes.
B: Alfred receives the correct number of votes.

Given that Monika received 7 votes and Alfred received 3 votes in the original election, there are only two cases where both students would receive the correct number of votes:

Case 1: The machine assigns all 7 votes to Monika correctly and all 3 votes to Alfred correctly.

The probability of assigning all 7 votes to Monika correctly is (1/2)^7, since for each vote, the machine has a 1/2 chance of assigning it correctly.

Similarly, the probability of assigning all 3 votes to Alfred correctly is (1/2)^3.

So, the probability of Case 1 occurring is (1/2)^7 * (1/2)^3 = (1/2)^10.

Case 2: The machine assigns all 7 votes to Alfred correctly and all 3 votes to Monika correctly.

The probability of assigning all 7 votes to Alfred correctly is (1/2)^7.

Similarly, the probability of assigning all 3 votes to Monika correctly is (1/2)^3.

So, the probability of Case 2 occurring is (1/2)^7 * (1/2)^3 = (1/2)^10.

Since these are the only two cases where both students receive the correct number of votes, the total probability is the sum of the probabilities of Case 1 and Case 2:

(1/2)^10 + (1/2)^10 = 2*(1/2)^10 = 2/1024 = 1/512.

Therefore, the probability that the machine gave each student the correct number of votes is 1/512.

The value of a+b is 1+512 = 513.