Is MEHulk actively avoiding Matches?

supergarv
supergarv Posts: 410 Mover and Shaker
i just played like 5 matches with my 1/1/1 Hulk in PVP. In those, I got maxbe 3 turns (out of... 50?) where his tile switch actually matched a tile.

Just my bad luck, or is the AI trying to switch tiles that will not result in a tile match, and those 3 occasions wherr actually a failstate of the AI? ;-)

Comments

  • Jaedenkaal
    Jaedenkaal Posts: 3,357 Chairperson of the Boards
    supergarv said:
    i just played like 5 matches with my 1/1/1 Hulk in PVP. In those, I got maxbe 3 turns (out of... 50?) where his tile switch actually matched a tile.

    Just my bad luck, or is the AI trying to switch tiles that will not result in a tile match, and those 3 occasions wherr actually a failstate of the AI? ;-)
    It's random, so, bad luck. It's not intentionally trying to match (or not match) anything. 
  • Calnexin
    Calnexin Posts: 1,078 Chairperson of the Boards
    I don't think I've had one yet, but I'm not surprised.  "Any two tiles" out of 64 - I don't know how to do the statistics on that, but the event of those two tiles filling in 3-in-a-row or greater are not favorable.  Even less so for both tiles to match simultaneously.

    This is just such an odd power to me.  I suppose getting it to lv 4 might be more interesting.  It's a free miniature Loki purple.  That can cause a little bit of havoc, potentially, but it's just as likely to mess up matches you were trying to engineer.
  • supergarv
    supergarv Posts: 410 Mover and Shaker
    Awesome, thanks for that math. A bit underwhelming though, added that his other activr powers cost more than I gather in a match ;-)
  • Jaedenkaal
    Jaedenkaal Posts: 3,357 Chairperson of the Boards
    Sandmaker said:
    There's 64 tiles on the board:

    4 corner tiles (2 possible directions to move each)
    6*4 = 24 edge tiles (3 possible directions to move each)
    6*6 = 36 center tiles (4 possible directions to move)

    So 4*2 + 24*3 +36*4 = 224 possible moves 

    How many match do you typically see on a board? like 5-10? (I'm erring on the high side.)

    Each unique match is actually 2 possible moves (e.g in an up/down swap, you can either move the top tile down, or bottom tile up to make the same match.), which gives us about 10-20 matching moves on average on a board. 

    10/224 = 0.044 chance to make a match 
    15/224 = 0.066 chance to make a match
    20/224 = 0.088 chance to make a match

    Your observation:

    3/50 = 0.06 

    Looks okay to me.

    Incidentally, you can also use this to calculate the expected ap gain/damage from the ability.
    It's not a match attempt, it's a swap of any two tiles on the board. Corner tiles have the same number of swap possibilities as any other tile. Think Coulson or Quicksilver (except random), or Devil Dino.
  • Sandmaker
    Sandmaker Posts: 208 Tile Toppler
    Sandmaker said:
    There's 64 tiles on the board:

    4 corner tiles (2 possible directions to move each)
    6*4 = 24 edge tiles (3 possible directions to move each)
    6*6 = 36 center tiles (4 possible directions to move)

    So 4*2 + 24*3 +36*4 = 224 possible moves 

    How many match do you typically see on a board? like 5-10? (I'm erring on the high side.)

    Each unique match is actually 2 possible moves (e.g in an up/down swap, you can either move the top tile down, or bottom tile up to make the same match.), which gives us about 10-20 matching moves on average on a board. 

    10/224 = 0.044 chance to make a match 
    15/224 = 0.066 chance to make a match
    20/224 = 0.088 chance to make a match

    Your observation:

    3/50 = 0.06 

    Looks okay to me.

    Incidentally, you can also use this to calculate the expected ap gain/damage from the ability.
    It's not a match attempt, it's a swap of any two tiles on the board. Corner tiles have the same number of swap possibilities as any other tile. Think Coulson or Quicksilver (except random), or Devil Dino.
    Whoops. Thought it was adjacent swaps for some reason. Nevermind then. 
  • AXP_isme
    AXP_isme Posts: 809 Critical Contributor
    You would probably be better off simulating this rather than trying to solve for it in the abstract. Writing a simple simulation script and brute-forcing iterations would be simpler to understand, interpret and ‘solve for’. 
  • Akari
    Akari Posts: 492 Mover and Shaker
    All I know is that every time there's a match 4 or 5 on the board, MEH swaps it away from me.
  • broll
    broll Posts: 4,732 Chairperson of the Boards
    Sandmaker said:
    There's 64 tiles on the board:

    4 corner tiles (2 possible directions to move each)
    6*4 = 24 edge tiles (3 possible directions to move each)
    6*6 = 36 center tiles (4 possible directions to move)

    So 4*2 + 24*3 +36*4 = 224 possible moves 

    How many match do you typically see on a board? like 5-10? (I'm erring on the high side.)

    Each unique match is actually 2 possible moves (e.g in an up/down swap, you can either move the top tile down, or bottom tile up to make the same match.), which gives us about 10-20 matching moves on average on a board. 

    10/224 = 0.044 chance to make a match 
    15/224 = 0.066 chance to make a match
    20/224 = 0.088 chance to make a match

    Your observation:

    3/50 = 0.06 

    Looks okay to me.

    Incidentally, you can also use this to calculate the expected ap gain/damage from the ability.
    It's not a match attempt, it's a swap of any two tiles on the board. Corner tiles have the same number of swap possibilities as any other tile. Think Coulson or Quicksilver (except random), or Devil Dino.
    That fact only makes it even more rare by making the possible number of swaps significantly higher.  Any one tile can be moved 63 other locations x 2.  I'm not good with stats, but it seems that 6% estimate up there is very high compared to the actual odds.  Probably more 0.06%.
  • thedarkphoenix
    thedarkphoenix Posts: 557 Critical Contributor
    I've had it happen alot, even got a crit tile out of it once.
  • Nick441234
    Nick441234 Posts: 1,496 Chairperson of the Boards
    Akari said:
    All I know is that every time there's a match 4 or 5 on the board, MEH swaps it away from me.
    I've had that happen to me loads in PVE. He's annoying more than useful, I wont ever use him. 
  • carrion_pigeons
    carrion_pigeons Posts: 942 Critical Contributor
    edited November 2017
    With an average of about 9 tiles of a given color on the board at a time, I'm figuring an average of 4.5 pairs of tiles which share a color and are adjacent.  I'll assume each such pair has two places to move a tile to, to make a match (this isn't true for pairs on the edge of the board, but it's pretty close to two).  Then account for tiles of the same color which are one space apart, to get 13.5 places on an average board to which a tile could be moved to make a match at any given time.

    So, 13.5*2/64 of a chance that a tile is moved to that position (since two distinct tiles are always chosen, out of 64 possibilities), and 1/7 of a chance of the tile being the correct color.  That gives you about a 6% chance of a match being made.

    3/50 sounds just about exactly right.
  • sambrookjm
    sambrookjm Posts: 2,163 Chairperson of the Boards
    edited November 2017
    I wrote up a quick MATLAB script to simulate what the odds are of the random swap resulting in a match.  It starts with 8x8 board with seven different tiles, and no already-there 3-in-a-row tiles.  It then randomly switches 2 tiles, and checks to see if there is a match.  With 1 million sims, it resulted in at least one match 12.7% of the time.  There was only one time in the million sims where it resulted in a dual match-5.

    If you get that power up to where it switches two tiles, the odds (as you would expect) nearly double.  The sim switched one pair of tiles, and then another pair of tiles.  A tile could have been switched with each pair, which I believe can happen with this ability...and I suppose if you wait around long enough, you'd see a pair of tiles switched and then switched back. :)  In any event, the odds of at least one hit were 22.85%  The best match was an absolutely enormous match that blew up three rows, two columns, and would have given 12 AP of a single color.  Naturally, the AI would have got this one.

    Short answer - Over a small sample size, it's quite possible to see a 6% success rate.  That's RNG at work.  Overall, you should hit at about double that rate.
  • Jarvind
    Jarvind Posts: 1,684 Chairperson of the Boards
    It's streaky like everything else. I've gone 3 games where he never makes a match, then he'll make three in a row. As always, the answer is "random is random."
  • Sandmaker
    Sandmaker Posts: 208 Tile Toppler
    edited November 2017
    I wrote up a quick MATLAB script to simulate what the odds are of the random swap resulting in a match.  It starts with 8x8 board with seven different tiles, and no already-there 3-in-a-row tiles.  It then randomly switches 2 tiles, and checks to see if there is a match.  With 1 million sims, it resulted in at least one match 12.7% of the time.  There was only one time in the million sims where it resulted in a dual match-5.

    If you get that power up to where it switches two tiles, the odds (as you would expect) nearly double.  The sim switched one pair of tiles, and then another pair of tiles.  A tile could have been switched with each pair, which I believe can happen with this ability...and I suppose if you wait around long enough, you'd see a pair of tiles switched and then switched back. :)  In any event, the odds of at least one hit were 22.85%  The best match was an absolutely enormous match that blew up three rows, two columns, and would have given 12 AP of a single color.  Naturally, the AI would have got this one.

    Short answer - Over a small sample size, it's quite possible to see a 6% success rate.  That's RNG at work.  Overall, you should hit at about double that rate.
    What was the average AP earned per turn? (Assuming you kept track of cascades.) 
  • sambrookjm
    sambrookjm Posts: 2,163 Chairperson of the Boards
    Sandmaker said:
    I wrote up a quick MATLAB script to simulate what the odds are of the random swap resulting in a match.  It starts with 8x8 board with seven different tiles, and no already-there 3-in-a-row tiles.  It then randomly switches 2 tiles, and checks to see if there is a match.  With 1 million sims, it resulted in at least one match 12.7% of the time.  There was only one time in the million sims where it resulted in a dual match-5.

    If you get that power up to where it switches two tiles, the odds (as you would expect) nearly double.  The sim switched one pair of tiles, and then another pair of tiles.  A tile could have been switched with each pair, which I believe can happen with this ability...and I suppose if you wait around long enough, you'd see a pair of tiles switched and then switched back. :)  In any event, the odds of at least one hit were 22.85%  The best match was an absolutely enormous match that blew up three rows, two columns, and would have given 12 AP of a single color.  Naturally, the AI would have got this one.

    Short answer - Over a small sample size, it's quite possible to see a 6% success rate.  That's RNG at work.  Overall, you should hit at about double that rate.
    What was the average AP earned per turn? (Assuming you kept track of cascades.) 

    No cascades in this one.  As I said, it was a very simple script that only did the random swap.  The vast majority of the matches, as you would expect, were simple 3-in-a-row.  Four in a row was less common, and two 3-in-a-row were even less common than that.  Fives were exceedingly rare.  Overall, it was a little more than 1 extra AP every two turns for a single swap, not including cascades.  For two swaps, it's a little more than one AP per turn.  Obviously, cascades would add a slight amount tot this value.
  • Jaedenkaal
    Jaedenkaal Posts: 3,357 Chairperson of the Boards
    I wrote up a quick MATLAB script to simulate what the odds are of the random swap resulting in a match.  It starts with 8x8 board with seven different tiles, and no already-there 3-in-a-row tiles.  It then randomly switches 2 tiles, and checks to see if there is a match.  With 1 million sims, it resulted in at least one match 12.7% of the time.  There was only one time in the million sims where it resulted in a dual match-5.

    If you get that power up to where it switches two tiles, the odds (as you would expect) nearly double.  The sim switched one pair of tiles, and then another pair of tiles.  A tile could have been switched with each pair, which I believe can happen with this ability...and I suppose if you wait around long enough, you'd see a pair of tiles switched and then switched back. :)  In any event, the odds of at least one hit were 22.85%  The best match was an absolutely enormous match that blew up three rows, two columns, and would have given 12 AP of a single color.  Naturally, the AI would have got this one.

    Short answer - Over a small sample size, it's quite possible to see a 6% success rate.  That's RNG at work.  Overall, you should hit at about double that rate.
    By the way, Team-Up tiles only have a 10% spawn rate; the other 6 colors have a 15% spawn rate. Not sure if you took that into account.

    Also, the double swap selects two pairs of tiles, and then swaps all 4 at the same time. I don't believe it's possible for the same tile to be swapped twice (or the same pair of tiles swapped, and then swapped back, although that would be vanishing-ly rare even if possible)
  • sambrookjm
    sambrookjm Posts: 2,163 Chairperson of the Boards
    By the way, Team-Up tiles only have a 10% spawn rate; the other 6 colors have a 15% spawn rate. Not sure if you took that into account.

    I didn't take that into account, because I didn't know that!  Where is that documented?  That might change the success rate very slightly, but not a huge amount.

    Also, the double swap selects two pairs of tiles, and then swaps all 4 at the same time. I don't believe it's possible for the same tile to be swapped twice (or the same pair of tiles swapped, and then swapped back, although that would be vanishing-ly rare even if possible)
    I wasn't quite sure how that worked, so I decided to play it safe and assume that the same tile could be switched out twice.  That actually makes it somewhat easier, and should be ever-so-slightly quicker to run.
  • Jaedenkaal
    Jaedenkaal Posts: 3,357 Chairperson of the Boards
    By the way, Team-Up tiles only have a 10% spawn rate; the other 6 colors have a 15% spawn rate. Not sure if you took that into account.

    I didn't take that into account, because I didn't know that!  Where is that documented?  That might change the success rate very slightly, but not a huge amount.
    https://www.demiurgestudios.com/engineering/a-worthy-opponent/

    It's an interesting read. Some choose to interpret it as pure propaganda. I think that's highly unlikely, mainly because the explanation given regarding the AI's behavior is by far the simplest way to implement.
    The part relevant to this discussion is:

    The computer does not try to screw up your turn by dropping bad tiles either. Each new tile is selected at random, individually, without any feedback from the swap‑selection code.  I did learn that Team-Up tiles drop with a slightly lower rate than color tiles.  Each color is weighted with a value of 1.0, while Team‑Up tiles are weighted with 0.75.  That means there's about an 11% chance that a new tile will be a Team‑Up, and about a 15% chance for each of the colors.

    Also, the double swap selects two pairs of tiles, and then swaps all 4 at the same time. I don't believe it's possible for the same tile to be swapped twice (or the same pair of tiles swapped, and then swapped back, although that would be vanishing-ly rare even if possible)
    I wasn't quite sure how that worked, so I decided to play it safe and assume that the same tile could be switched out twice.  That actually makes it somewhat easier, and should be ever-so-slightly quicker to run.
    Well to be fair, I'm not sure either. :) I'd assumed the code would simply select 4 different tiles at random, and then swap 1 with 2 and 3 with 4. Presumably that's also how they handle a 5-cover Switcheroo when the AI uses it.

  • sambrookjm
    sambrookjm Posts: 2,163 Chairperson of the Boards
    I did a quick rewrite of the script to correct for the change in tile appearance rate, as well as the no switching the same tile twice.  There was pretty much no change at all in the rate of a "successful" switch for either one or two matches.  It was back in the third decimal point, which I can chalk up to random noise.  The AP generated was about the same as well.
This discussion has been closed.