While playing marbles, your first opponent won half your marbles plus 4 marbles. You lost half of what was left plus 3 marbles to your second opponent, You lost half of what was then left plus 2 more to the third opponent and your fourth opponent won your only remaining marble. How many marbles did you have to begin with?

To find out how many marbles you had to begin with, we can work backwards from the information given.

Let's start with the last event: the fourth opponent won your only remaining marble. This means that after playing against the third opponent, you had only one marble left.

Before playing against the third opponent, you lost half of what was left plus 2 more to them. So, let's backtrack a bit. If at that point you had one marble left, then before playing against the third opponent, you must have had 1 * 2 + 2 = 4 marbles.

Again, before playing against the second opponent, you lost half of what was left plus 3 marbles to them. So, let's go back further. If at that point you had 4 marbles left, then before playing against the second opponent, you must have had 4 * 2 + 3 = 11 marbles.

Now, before playing against the first opponent, you lost half your marbles plus 4 marbles to them. Going back again, if at that point you had 11 marbles left, then before playing against the first opponent, you must have had 11 * 2 + 4 = 26 marbles.

Therefore, you began with 26 marbles.