Bitcoin Forum
December 08, 2016, 04:21:23 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Gambling: Bitcoin Darts  (Read 3291 times)
mizerydearia
Hero Member
*****
Offline Offline

Activity: 574



View Profile
January 01, 2011, 10:24:46 AM
 #1

I encountered Bitcoin Darts and played a total of ten times each for 0.1btc.  I came out ahead by 0.41btc.  So I decided to investigate further the odds of winning.

I analyzed the PNG image and noticed a bit of antialiasing and also a bit of green bleeding into the bullseye area.  Additionally I wasn't certain how to evaluate the black pixels, whether they are to be included and if so which color to evaluate it as.  I figured perhaps the code is designed to regenerate a position if black is picked.  Additionally I wasn't certain how the code would handle antialiased pixels that do not match the exact rgb value of the majority of colors, so I recreated another image with no antialiasing that I then wrote a script and parsed the data from.

Attached is the image I produced and below is a PHP script I wrote to gather and output the following data:

Code:
<?php
$im = @imagecreatefrompng("5x2ki8jf.png");
$imx imagesx($im);
$imy imagesy($im);

$odds 65535;

$pixels = array(
"Bullseye" => array("count" => 0"pays" => 5),
"Double Bullseye" => array("count" => 0"pays" => 10),
"Blue" => array("count" => 0"pays" => 2),
"Blue Inner" => array("count" => 0"pays" => 6),
"Blue Outer" => array("count" => 0"pays" => 4),
"Purple" => array("count" => 0"pays" => 1.2),
"Purple Inner" => array("count" => 0"pays" => 3.6),
"Purple Outer" => array("count" => 0"pays" => 2.4),
"Cyan" => array("count" => 0"pays" => 1),
"Cyan Inner" => array("count" => 0"pays" => 3),
"Cyan Outer" => array("count" => 0"pays" => 2),
"Red" => array("count" => 0"pays" => .5),
"Red Inner" => array("count" => 0"pays" => 1.5),
"Red Outer" => array("count" => 0"pays" => 1),
"Green" => array("count" => 0"pays" => .2),
"Green Inner" => array("count" => 0"pays" => .6),
"Green Outer" => array("count" => 0"pays" => .4),
"Outside" => array("count" => 0"pays" => 0),
"Black" => array("count" => 0"pays" => 0)
);

for ($y 0$y <= $imy$y++) {
for ($x 0$x <= $imx$x++) {
$color_index imagecolorat($im$x$y);
$color imagecolorsforindex($im$color_index);
$r $color["red"];
$g $color["green"];
$b $color["blue"];
$a $color["alpha"];
if ($r == && $g == && $b == && $a == 127$pixels["Outside"]["count"]++;
else if ($r == && $g == && $b == && $a == 0$pixels["Black"]["count"]++;
else if ($r == 74 && $g == 74 && $b == 255 && $a == 0$pixels["Blue Outer"]["count"]++;
else if ($r == 255 && $g == 66 && $b == 66 && $a == 0$pixels["Red Outer"]["count"]++;
else if ($r == 130 && $g == 254 && $b == 255 && $a == 0$pixels["Cyan Outer"]["count"]++;
else if ($r == 255 && $g == 74 && $b == 253 && $a == 0$pixels["Purple Outer"]["count"]++;
else if ($r == && $g == && $b == 255 && $a == 0$pixels["Blue"]["count"]++;
else if ($r == 255 && $g == && $b == && $a == 0$pixels["Red"]["count"]++;
else if ($r == && $g == 252 && $b == 255 && $a == 0$pixels["Cyan"]["count"]++;
else if ($r == 255 && $g == && $b == 252 && $a == 0$pixels["Purple"]["count"]++;
else if ($r == 77 && $g == 255 && $b == 77 && $a == 0$pixels["Green Outer"]["count"]++;
else if ($r == && $g == 255 && $b == && $a == 0$pixels["Green"]["count"]++;
else if ($r == && $g == && $b == 180 && $a == 0$pixels["Blue Inner"]["count"]++;
else if ($r == 189 && $g == && $b == && $a == 0$pixels["Red Inner"]["count"]++;
else if ($r == && $g == 179 && $b == 181 && $a == 0$pixels["Cyan Inner"]["count"]++;
else if ($r == 181 && $g == && $b == 179 && $a == 0$pixels["Purple Inner"]["count"]++;
else if ($r == && $g == 181 && $b == && $a == 0$pixels["Green Inner"]["count"]++;
else if ($r == 189 && $g == 125 && $b == && $a == 0$pixels["Bullseye"]["count"]++;
else if ($r == 255 && $g == 168 && $b == && $a == 0$pixels["Double Bullseye"]["count"]++;
//else if ($r ==  && $g ==  && $b ==  && $a == 0) $pixels[""]["count"]++;
else echo "$r $g $b $a<br>";
}
}
echo "<table><tr><th>Color</th><th># Pixels</th><th>Chance</th><th>Payout</th></tr>";
foreach ($pixels as $color => $data) {
?>

 <tr>
  <td><?php echo $color?></td>
  <td><?php echo $data["count"]; ?></td>
  <td><?php echo number_format($data["count"] / $odds 1002); ?>%</td>
  <td><?php echo $data["pays"] * 100?>%</td>
 </tr>
<?php ?>
</table>

Code:
Color           # Pixels Chance Payout
Double Bullseye    72     0.11% 1000%
Blue Inner        655     1.00%  600%
Bullseye          440     0.67%  500%
Blue Outer        760     1.16%  400%
Purple Inner      780     1.19%  360%
Cyan Inner        839     1.28%  300%
Purple Outer      923     1.41%  240%
Blue             4796     7.32%  200%
Cyan Outer        984     1.50%  200%
Red Inner         792     1.21%  150%
Purple           5622     8.58%  120%
Cyan             6173     9.42%  100%
Red Outer         958     1.46%  100%
Green Inner      1122     1.71%   60%
Red              5812    8.87%    50%
Green Outer      1282     1.96%   40%
Green            8196    12.51%   20%
Outside         16156    24.65%    0%
Black            9687    14.78%    ?%

Chances of winning or breaking even: 0.11 + 1.00 + 0.67 + 1.16 + 1.19 + 1.28 + 1.41 + 7.32 + 1.50 + 1.21 + 8.58 + 9.42 + 1.46 = 36.31%
Chances of losing: 1.71 + 8.87 + 1.96 + 12.51 + 24.65 + 14.78 = 64.48%

Otherwise if as suggested above, black pixels are not included, then

Code:
Color           # Pixels Chance Payout
Double Bullseye    72     0.13% 1000%
Blue Inner        655     1.17%  600%
Bullseye          440     0.79%  500%
Blue Outer        760     1.36%  400%
Purple Inner      780     1.40%  360%
Cyan Inner        839     1.50%  300%
Purple Outer      923     1.65%  240%
Blue             4796     8.59%  200%
Cyan Outer        984     1.76%  200%
Red Inner         792     1.42%  150%
Purple           5622    10.07%  120%
Cyan             6173    11.05%  100%
Red Outer         958     1.72%  100%
Green Inner      1122     2.01%   60%
Red              5812    10.41%   50%
Green Outer      1282     2.30%   40%
Green            8196    14.68%   20%
Outside         16156    28.93%    0%

Chances of winning or breaking even: 0.13 + 1.17 + 0.79 + 1.36 + 1.40 + 1.50 + 1.65 + 8.59 + 1.76 + 1.42 + 10.07 + 11.05 + 1.72 = 42.61%
Chances of losing: 2.01 + 10.41 + 2.30 + 14.68 + 28.93 = 58.33%

Note: The site was also mentioned a few times: originally here, laterly here, more laterly here, even more laterly here and second to lastly here but not here.
Also Statistics
1481214083
Hero Member
*
Offline Offline

Posts: 1481214083

View Profile Personal Message (Offline)

Ignore
1481214083
Reply with quote  #2

1481214083
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481214083
Hero Member
*
Offline Offline

Posts: 1481214083

View Profile Personal Message (Offline)

Ignore
1481214083
Reply with quote  #2

1481214083
Report to moderator
1481214083
Hero Member
*
Offline Offline

Posts: 1481214083

View Profile Personal Message (Offline)

Ignore
1481214083
Reply with quote  #2

1481214083
Report to moderator
1481214083
Hero Member
*
Offline Offline

Posts: 1481214083

View Profile Personal Message (Offline)

Ignore
1481214083
Reply with quote  #2

1481214083
Report to moderator
bitcoinex
Sr. Member
****
Offline Offline

Activity: 350


probiwon.com


View Profile WWW
January 08, 2011, 04:12:36 AM
 #2

my calculations:

chance * payot + ... + chance * payot = ~0.69%

New bitcoin lottery: probiwon.com
- Может, ты ещё и в Невидимую Руку Рынка веруешь? - Зачем же веровать в то, что можно наблюдать непосредственно?
Mahkul
Sr. Member
****
Offline Offline

Activity: 420


Be silent, or be silenced.


View Profile WWW
January 08, 2011, 03:13:23 PM
 #3

It would be nice if someone ported this to facebook and the likes.

Bitalo.com coming soon!

1MAHKULzqZb4evFFg9157LvnJhJQQbeYo7
bitcoinex
Sr. Member
****
Offline Offline

Activity: 350


probiwon.com


View Profile WWW
January 08, 2011, 04:47:15 PM
 #4

It would be nice if someone ported this to facebook and the likes.

I think this is prohibited by facebook rules

New bitcoin lottery: probiwon.com
- Может, ты ещё и в Невидимую Руку Рынка веруешь? - Зачем же веровать в то, что можно наблюдать непосредственно?
Gluskab
Jr. Member
*
Offline Offline

Activity: 42


View Profile WWW
April 15, 2011, 08:36:40 AM
 #5

my calculations:

chance * payot + ... + chance * payot = ~0.69%

I got .89 for the "Not including black" table and .76 for the other one.

http://www.twitter.com/EverydayAgorism/
Check out my blog on Bitcoin and Agorism! http://www.practicalagorism.com/
BTC : 173nD33C17211xUiViDArdLcriV6NSpaEP
mskwik
Full Member
***
Offline Offline

Activity: 125


View Profile
April 15, 2011, 03:18:44 PM
 #6

The black outline is actually a layer over the board part that is used to calculate the outcome, so the black pixels are calculated as the color underneath.  The official calculation is done from a database table that was made at the same time as the image by dumping the section information when they were still separate layers as well, so the edges where they run into each other may not match the image exactly.  I've always done stats calculations off the database and just considered the image as a visual, so far I've only had to adjust the database once when it called a pixel that was clearly well off the board as a double bullseye (must have had a stray pixel on that layer)

I think I've shared the board stats before but not sure where so I will pull them again, just to give an "official" number to compare your stats to.  (Not that there's any sure way for you to verify this, but it's where my payout numbers come from)

Code:
mysql> select darts_section.comment,darts_section.amtback,count(darts_section.id) from darts_board left join darts_section on darts_board.section=darts_section.id group by darts_section.id order by amtback desc;
+-----------------+---------+-------------------------+
| comment         | amtback | count(darts_section.id) |
+-----------------+---------+-------------------------+
| Double Bullseye |    1000 |                     116 |
| Blue Triple     |     600 |                     781 |
| Bullseye        |     500 |                     566 |
| Blue Double     |     400 |                    1226 |
| Purple Triple   |     360 |                    1006 |
| Cyan Triple     |     300 |                    1026 |
| Purple Double   |     240 |                    1555 |
| Blue            |     200 |                    5221 |
| Cyan Double     |     200 |                    1600 |
| Red Triple      |     150 |                     972 |
| Purple          |     120 |                    7076 |
| Cyan            |     100 |                    7116 |
| Red Double      |     100 |                    1556 |
| Green Triple    |      60 |                    1259 |
| Red             |      50 |                    6632 |
| Green Double    |      40 |                    2194 |
| Green           |      20 |                    8365 |
| Off the Board   |       0 |                   17269 |
+-----------------+---------+-------------------------+
18 rows in set (0.30 sec)

mysql> select darts_section.comment,darts_section.amtback*count(darts_section.id)/65536 as payoutpct from darts_board left join darts_section on darts_board.section=darts_section.id group by darts_section.id order by amtback desc;
+-----------------+-----------+
| comment         | payoutpct |
+-----------------+-----------+
| Double Bullseye |    1.7700 |
| Blue Triple     |    7.1503 |
| Bullseye        |    4.3182 |
| Blue Double     |    7.4829 |
| Purple Triple   |    5.5261 |
| Cyan Triple     |    4.6967 |
| Purple Double   |    5.6946 |
| Blue            |   15.9332 |
| Cyan Double     |    4.8828 |
| Red Triple      |    2.2247 |
| Purple          |   12.9565 |
| Cyan            |   10.8582 |
| Red Double      |    2.3743 |
| Green Triple    |    1.1526 |
| Red             |    5.0598 |
| Green Double    |    1.3391 |
| Green           |    2.5528 |
| Off the Board   |    0.0000 |
+-----------------+-----------+
18 rows in set (0.25 sec)

Which should add up to the 96% that I normally give as the average payout %

And just for good measure (without actual totals)
Code:
mysql> select sum(amountout)/sum(amountin) from darts_transaction where status>7;
+------------------------------+
| sum(amountout)/sum(amountin) |
+------------------------------+
|               0.943374072162 |
+------------------------------+
1 row in set (0.00 sec)

Gotten enough plays now that it doesn't vary too much anymore, mostly tends to drift down slowly with upward jumps when someone wins big.

doldoltom12
Newbie
*
Offline Offline

Activity: 5



View Profile
September 01, 2013, 09:05:40 PM
 #7

I played 10 times lost 6 times and I won 4 bets, I guesshttp://btcall.allalla.com/0.jpg it's still not fair.

 *Image Removed*
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!