Say you have an amount of 350 credits
and 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?