What is the best choice in a win/lose game and how to calculate it Say you have an amount of 350 creditsand you have 4 options:
1) put 50 credits and in case of a win you double your credits to 100 and therefor you have total a of 400 credits, but in case of a loss you still have 300 credits
2) put 150 credits and in case of a win you double your credits to 300 and therefor you have total a of 500 credits, but in case of a loss you still have 200 credits
3) put 250 credits and in case of a win you double your credits to 500 and therefor you have total a of 600 credits, but in case of a loss you still have 100 credits
4) put all 350 credits and in case of a win you double your credits to 700 and therefor you have total a of 700 credits, but in case of a loss you will have 0 credits
What I'm wondering is is there a mathematical "algorithm" which would give me the best acceptable option?
 A: When problems in gambling are posed in a mathematical sense, it is usually assumed that utility is linear in expectation, so you are indifferent between having 350 and  a 50% chance of having 350-x and a 50% chance of having 350+x for any x.  This is particularly the spirit of André Nicolas' comments.  If that is true and the bet is fair, math can't help you-all these options (as well as the one of not playing) are equivalent.
Many (most?) people would find being broke much more of a downgrade than being twice as rich is an upgrade, so would not make this bet with their entire net worth.  In this case, they should not take this bet for their net worth.
On the other hand, many people reason that losing \$1 won't make any difference to their life, but winning $x,000,000 would be wonderful, so they play the lottery.
There is a whole part of economics/psychology that addresses this, but you are in the wrong place for it.
A: The "best choice" is the one that maximizes your expected utility.  It therefore depends on your utility function, i.e. your preferences.  For example, if there's something you really want right now that costs 700 credits, the last is the best option.  If it only costs 500 but other than that money is worth more to you when you have less of it (as is the case for most people), the second option is better assuming a 50% win chance.  And so on.  If there's a different win chance, that has to be taken into account as well.
