• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Jan 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1.
2. ### STAKE & NUMBER_OF_BETS ###
3. stake_1 = 0.1
4. stake_2 = 0.2
5. stake_3 = 0.3
6. stake_4 = 0.4
7. stake_5 = 0.5
8.
9. ### Please uncomment wanted amount of bets:
10. number_of_bets = 100
11. #number_of_bets = 250
12. #number_of_bets = 500
13. #number_of_bets = 1000
14. #number_of_bets = 2500
15.
16.
17. ### Please uncomment wanted value for interval on x axis:
18. inter = 17 #for number_of_bets == 100
19. #inter = 23; #for number_of_bets = 250
20. #inter = 34; #for number_of_bets == 500
21. #inter = 50; #for number_of_bets == 1000
22. #inter = 100; #for number_of_bets == 2500
23.
24.
25. base = 100 # any value
26. p = 0.6 # probability == 60%
27. probability = dbinom(0:number_of_bets,number_of_bets, p)
28. s = (0:number_of_bets)
29.
30. ### Please feel free to change stake percent
31. final_bankroll_1 = base*(1+stake_1)^s*(1-stake_1)^(number_of_bets-s) #calculation for final_bankroll_1 for stake == 10%
32. final_bankroll_2 = base*(1+stake_2)^s*(1-stake_2)^(number_of_bets-s) #calculation for final_bankroll_2 for stake == 20%
33. final_bankroll_3 = base*(1+stake_3)^s*(1-stake_3)^(number_of_bets-s) #calculation for final_bankroll_3 for stake == 30%
34. final_bankroll_4 = base*(1+stake_4)^s*(1-stake_4)^(number_of_bets-s) #calculation for final_bankroll_4 for stake == 40%
35. final_bankroll_5 = base*(1+stake_5)^s*(1-stake_5)^(number_of_bets-s) #calculation for final_bankroll_5 for stake == 50%
36.
37. ### Please uncomment if you want to see data.frame of final_bankroll's and probability
38. #print (data.frame(final_bankroll_1, probability)) #printing the aktual values for final_bankroll_1
39. #print (data.frame(final_bankroll_2, probability)) #printing the aktual values for final_bankroll_2
40. #print (data.frame(final_bankroll_3, probability)) #printing the aktual values for final_bankroll_3
41. #print (data.frame(final_bankroll_4, probability)) #printing the aktual values for final_bankroll_4
42. #print (data.frame(final_bankroll_5, probability)) #printing the aktual values for final_bankroll_5
43.
44.
45. ### visualization of both bankrolls using log() function
46. plot(log(final_bankroll_1), probability, type="h",  xlim = c(0, inter))
47. par(new = TRUE)
48. #plot(log(final_bankroll_2), probability, type="h", col = "red", xlim = c(0, inter))
49. #plot(log(final_bankroll_3), probability, type="h", col = "red", xlim = c(0, inter))
50. #plot(log(final_bankroll_4), probability, type="h", col = "red", xlim = c(0, inter))
51. plot(log(final_bankroll_5), probability, type="h", col = "red", xlim = c(0, inter))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?