Most users ever online was 263 on 2020-Apr-18 20:02
Users in total:
Newest user:
26 users online:
21,879
Moriko
Daredevil Z 2 minutes ago

2/3, one more to go

Daredevil Z 29 minutes ago

3p fast

The Plumber from Asshai 6 hours ago

rated 3p anyone?

holtaf 8 hours ago

2/3

holtaf 8 hours ago

23

holtaf 8 hours ago

live 3p created, join up

SerOberynMartell 10 hours ago

omriex are you here?

SerOberynMartell 10 hours ago

Les sept couronnes waiting on you to ready up in live lobby

Soda-can 10 hours ago

One more! I'm hostage baby.

Soda-can 10 hours ago

3/6 LIVE

Soda-can 11 hours ago

It's really incredible to get to do this ²/6

Just do it 13 hours ago

3p live fast+

Daredevil Z 15 hours ago

3p live

CKyou2 17 hours ago

Ready?

CKyou2 17 hours ago

2/3

CKyou2 17 hours ago

1/3

Ihor 21 hours ago

2/3

Nicky 21 hours ago

Anyone 3p live?

Daredevil Z 24 hours ago

2/3

D_jaja 34 hours ago

5/6

Use me, make me your animal.



Community Forum
Search |  


Author
Message
WarlordBatz
Pawn

Posts: 5
Games: 14
Rank Points: 0
Member since: 2020-Oct-17

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-21 17:58
Hi

I am trying to work out the probabilities of ToB cards. But before I finish this can I ask does the Thronemaster implementation take account of the fact that one player must pick first?

Let me explain. As an example: there are 4 skull cards out of a deck of 24 cards. I cannot find anywhere who draws first so lets assume it is the attacker.

Attacker chance of drawing a skull is 4/24 (16.6%)
Now one card has gone so...
Defender chance of drawing a skull is 3/23 (13.0%)

Does the Thronemaster implementation work like this? Who picks first? Or does it just give both players 4/24 chance of getting a skull as if each have their own deck?

(The same odds shift happens for other cards other than Skulls, but this is the easiest example)

Thanks
Ian
Alrich
One Of The Kingsguard

Posts: 112
Games: 102
Rank Points: 849
Member since: 2015-Sep-27

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-21 19:08
The probability is the same
for the "first draw" the probability is : 4/24
For the "second draw" the probability is : 4/24 * 3/23 + 20/24 *4/23 = 4/24
PhantasticPhil
Hand Of The King

Posts: 205
Games: 558
Rank Points: 4,262
Member since: 2016-Jun-23

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-21 20:03
thankfully there are only 2 skull cards in a deck of ToB cards (still 2 too many)
but 16 % each battle that one of your units that would be even more fun


SerOberynMartell
Knight of the Water Gardens

Posts: 886
Games: 594
Rank Points: 3,873
Member since: 2014-Dec-16

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-21 20:53
The probability is the same
for the "first draw" the probability is : 4/24
For the "second draw" the probability is : 4/24 * 3/23 + 20/24 *4/23 = 4/24

Edit: NVM!
When I math this out I get 1/46 + 10/69 = 23/138 = 1/6


WarlordBatz
Pawn

Posts: 5
Games: 14
Rank Points: 0
Member since: 2020-Oct-17

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-21 22:44
Ah yes, thank you PhantasticPhil! It would have helped if I got the number of skull cards right, my bad.

So there are *2* Skull cards in the deck of 24.

So first to draw get a chance of 2 of 24 or 2/24 (8.3%)

The deck is now 23 cards one of which is a skull so their chance of picking that skull is 1 of 23 or 1/23 (4.3%)

But regardless of the actual numbers your replies confused me.

Just checking but did any of you write the code? If not I am hoping a site admin who knows the code can tell me how it is actually programmed.

As a footnote I found that this is called 'conditional probability' and described here in terms of the chance of drawing a second Ace from a deck of cards:

https://math.libretexts.org/Courses/College_of_the_Canyons/Math_100%3A_Liberal_Arts_Mathematics_(Gavilan_and_Radtke)/04%3A_Probability_and_Odds/4.02%3A_Conditional_Probability

or here

https://www.math.uni.edu/~campbell/mdm/hand.html
Necrarch
Knight of Ni

Posts: 2,050
Games: 135
Rank Points: 1,003
Member since: 2019-Feb-01

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-21 23:13
The only person that codes on this site is the site owner, JM Grip, so he is the only one that can confirm that. However, as ToB cards are reshuffled after every fight, the programming is less of an issue as you just make a "draw random two different cards among the 24 and give each of them to a player". And there are fortunately procedures for programmers so that they do not have to take care about how "random" works (a real random is actually extremely hard to program).

And JM is unfrotunately über busy, so I doubt he'll answer you.

It is actually not "real" conditional probability - Alrich as a statistician can confirm that because you don't know the first card to conclude - because a conditional probablility is assuming you know the first card and use that information before drawing the second one.

If you think about it, draw two cards, give the first one to player A and the second to player B.
Now, reshuffle, give the first card to player B and the second to player A. Does it change something as for probabilities ? No, obviously not. The only information you have, when you are player A, is that B cannot draw your card (if you have card number 7, obviously B cannot draw it), but the chances AT THE START to draw each of the 24 cards for B was exactly 1/24.

A bit counter-intuitive at start.


SerOberynMartell
Knight of the Water Gardens

Posts: 886
Games: 594
Rank Points: 3,873
Member since: 2014-Dec-16

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-21 23:43

So there are *2* Skull cards in the deck of 24.

So first to draw get a chance of 2 of 24 or 2/24 (8.3%)

The deck is now 23 cards one of which is a skull so their chance of picking that skull is 1 of 23 or 1/23 (4.3%)

...

As a footnote I found that this is called 'conditional probability' and described here in terms of the chance of drawing a second Ace from a deck of cards:

https://math.libretexts.org/Courses/College_of_the_Canyons/Math_100%3A_Liberal_Arts_Mathematics_(Gavilan_and_Radtke)/04%3A_Probability_and_Odds/4.02%3A_Conditional_Probability

or here

https://www.math.uni.edu/~campbell/mdm/hand.html

We can't always condition on the fact that the first person drew a skull. As Alrich noted, there is a 2/24 chance that the first person drew a skull, and therefore the probability of the second person drawing a skull  in that case is 1/23. However, there is also a 22/24 chance that the first person doesn't draw a skull, in which case the second person has a 2/23 chance of drawing a skull. Adding those two probabilities together shows that the probability of the second person drawing a skull is still 2/24, therefore making it unnecessary to determine who draws first


Alrich
One Of The Kingsguard

Posts: 112
Games: 102
Rank Points: 849
Member since: 2015-Sep-27

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-22 01:01
The probability is the same
for the "first draw" the probability is : 4/24
For the "second draw" the probability is : 4/24 * 3/23 + 20/24 *4/23 = 4/24

Edit: NVM!
When I math this out I get 1/46 + 10/69 = 23/138 = 1/6

That's because 1/6 = 4/24
WarlordBatz
Pawn

Posts: 5
Games: 14
Rank Points: 0
Member since: 2020-Oct-17

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-22 10:36
Thanks for the further explanations, it's a long time since I did probability at school and this thread reminds me how I didn't enjoy it all that much!!

I can see it now that this not Conditional Probability because we don't see the first draw.

So...

Given that when a player has the Valerian Steel Blade he can choose another card then a list of probabilities for each result should really be shown as two tables. The first table the simple 1/24 * the number of each card.

The second table being 1/23 for every card which you didn't pick * the number of each type of card. But an adjusted probability for the card you picked.

I think I am overthinking this for game purposes because it's obvious common sense that if you draw 1 of the 2 Skull cards the other person is only 1/23 likely to have the other.

But it is interesting from a probability point of view...

Thanks all!
Necrarch
Knight of Ni

Posts: 2,050
Games: 135
Rank Points: 1,003
Member since: 2019-Feb-01

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-22 11:02
As for the programming, honestly, I think there are functions in most languages that does that part for you.

You just describe to your program "card 1: +2 CS + 1 sword, card 2: +1 CS and 1 fort, card 3: +0 CS and 1 skull"... etc.

Then you tell your program "draw 2 different cards in these 24", and "if sword is used, replace card A by card C, that must be drawn in the remaining 22". It is not something in which you calculate your actual probabilities each time, but you just describe your cases and tell the computer to do the maths for you.

But the question is intersting indeed

Pretty much the same for events, actually, apart from the fact that they are not re-shuffled all the time, only if WiC is drawn.


JM Grip
The 8th God

Posts: 5,236
Games: 92
Rank Points: 686
Member since: 2007-Sep-28

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-22 13:53
something like that:
function getShuffledTidesOfBattle($battleData = false)
{
    $cards = array(
        1,
        1,
        1,
        1,
        1,
        1,
        1,
        1, // 8x +0 str.
        2,
        2, // 2x +0 str. + SKULL
        3,
        3,
        3,
        3, // 4x +1 str. + SWORD
        4,
        4,
        4,
        4, // 4x +1 str. + TOWER
        5,
        5,
        5,
        5, // 4x +2 str.
        6,
        6 // 2x +3 str.
    );
    // exclude drawn ToB cards during battle
    // ...
    $loop = rand(1, 5);
    while ($loop-- > 0) { // shuffle 1 to 5 times
        shuffle($cards);
    }
    return $cards;
}

Attacker gets the first cards, defender the second, but that is a neglectable detail. Drawing order has no meaning here.


WarlordBatz
Pawn

Posts: 5
Games: 14
Rank Points: 0
Member since: 2020-Oct-17

Topic: Tides of Battle - draw detail
Posted: 2021-Jan-22 15:50
Thanks you JM Grip for sharing the code.

Great to hear from "The 8th God" himself

(Edit: is that JavaScript it is written in?)

Please log in to use the reply function.
toast