Universal Threes! (by Sirvo LLC)

Discussion in 'iPhone and iPad Games' started by killercow, Feb 5, 2014.

  1. ArtNJ

    ArtNJ Well-Known Member

    Jul 13, 2009
    3,212
    29
    48
    New Jersey
    Why do we think there is a deck at all? Occam's Razor says that the simplest option is usually correct. It seems to me that a few basic formula and rules would be simpler to code than a deck. For example:

    Tile=

    [1 or 2]= x%

    -additional limiters possible, such as # of 1s cannot exceed # of 2s +Y (where Y is probably 4 or 5)

    [Odds of a Number Tile Other Than 1 or 2] = 100-x%

    Where Number is a set of permissible numbers based on how far you have gotten.

    If the set of permissible numbers in Number = P, the odds of any particular number could be 100/P if all numbers including 3 have an equal chance once they enter the set of possible numbers, although some sort of bias towards 3 seems likely -- i.e., either a fixed % chance of a 3, with the remaining possible numbers dividing the remaining % chance, or it could be that 3 is simply double or tripple weighted, so that the odds of a 3 go down as additional numbers enter the set of permissible numbers (Number).

    Again, I dont know, but just wondering if this simpler type of set up has been ruled out somehow.
     
  2. kamikaze28

    kamikaze28 <a href="https://itunes.apple.com/us/app/hundreds/

    It's a tried, tested and proven method for these kinds of games.

    That is the general principle of Occam's Razor. Looking at your set of formulas, rules and limiters I find ot to be quite complicated.

    From a "how would I implement this"-point of view, the undrawn stack is quite elegant. You create an object (let's call it "undrawn stack manager") with fixed parameters (N blue/red cards per stack) and some variable state (i. e. the highest card on the board), you initialize it and then just ask it to give you a card. If it runs out of its current internal stack, it creates a new one, shuffles it and draws you a card. Without much logic, checking and balancing you have thereby guaranteed that cards will come a fashion that is:
    - unpredictable (because the internal stack of cards is shuffled)
    - balanced (because N blue and N red cards [along with some white cards] have to be dealt out before a new stack is created)
    - flexible (in regards to the value of white cards. Once the highest card on the board is high enough, the "undrawn stack manager" can just shuffle in a few higher white cards along with the usual 3s.)

    I would rule it out by Occam's Razor. ;)
     
  3. ArtNJ

    ArtNJ Well-Known Member

    Jul 13, 2009
    3,212
    29
    48
    New Jersey
    It is easy enough to devise a test to determine if we are rule based or deck based, although a lot of effort would be required to actually run the test.

    If we are rule based, then the odds of drawing a colored tile ("1" or "2") should be the same regardless of how many have been played recently, whereas if we are deck based the odds should be different in definable situations.

    For simplicities sake, I'd look at the odds of drawing a colored tile over the first 10 draws over X number of games in three situations:

    (1) in the first 5 draws; and

    (2) in draws 6-10 when the number of colored tiles in the first 5 draws is in the bottom 50% of the sample;

    (3) in draws 6-10 when the number of colored tiles in the first 5 draws is in the top 50% of the sample.

    The problem with this test is that it would take a lot of games, and a lot of time, but I'd bet that is disproves the deck theory :)
     
  4. y2kmp3

    y2kmp3 Well-Known Member

    Jun 25, 2010
    1,784
    3
    38
    #324 y2kmp3, Feb 11, 2014
    Last edited: Feb 11, 2014
    Actually, I proposed the theory that the game is deliberately "adjusting" its odds dynamically to favor "unfavorable" tile position based on a small experiment I did, which I will describe here now. Both of you are referring to confirmation bias and recall bias (related to parts of cognitive bias, a term only commonly used in behavioral sciences and psychology. It is called by other names in other fields. See Sackett's work). I was fully of these biases and thus did an experiment to try to back up my theory before posting here before.

    Here is what I did.

    I played a number of games, recording ONLY instances when there are TWO DISTINCT choices where a new tile can appear after a swipe. Note that this does not occur every time, as only certain configurations permit this. For each trial, I made sure that there are two "moving" columns or rows so that they are indeed available to accept a new tile.

    I then decided A PRIORI which row or column is the "favorable" position and made a decision based on the tile I received:

    1) Tile appeared in favorable position.
    2) Tile appeared in unfavorable position.
    3) Tile appeared in positions that I did not care (These are rare cases whereby either choice made no difference in my strategy).

    There are the results. The trials were done over about half a dozen games or so.

    Number of suitable trials with "two" allowable choices for new tile to appear:
    236

    Number of times when the new tile appeared in the favorable position:
    67

    Number of times when the new tile appeared in the unfavorable position:
    150

    Number of times when the new tile's position mattered little in the strategy:
    19

    As you can see from these data above, the ratio of favorable to unfavorable positions is 67/150 = 0.45, much less than 1.0 that I had expected if truly randomness (chance) is the sole operator.

    These data suggest that the game is dynamically adjusting the odds so that the new tile is more likely going to a position in which you CANNOT use to make a match. The incentive for this is obviously to gradually DECREASE the number of open spaces. As you know, once the number of open spaces is reduced to only 1-2, you are basically at the mercy of the random tiles, as there is little room for you to recover should you get an unwanted tile.

    Is this fair? May be or may be not, depending on whether or not you consider this to be a fair mechanic. For me, the game should be upfront about this, since I view it as normal and reasonable expectation that the game's tiles are allocated randomly and are not stacked against you.

     
  5. Nicola Salmoria

    Nicola Salmoria Well-Known Member

    My impression while playing the game is that white cards become more frequent as you progress.

    Which would make sense because having to deal with lots of 1s and 2s with a 768 on the board would become quite tiresome.
     
  6. ArtNJ

    ArtNJ Well-Known Member

    Jul 13, 2009
    3,212
    29
    48
    New Jersey
    A lot more data would be required, but here is the results from 10 runs of my test:

    Overall odds of a colored tile: 73%. Yes, 73 of the 100 tiles drawn in my test were colored tiles. Which is interesting.

    Here is the breakdown:

    Runs With Two Colored Tiles In First 5:

    1 runs

    Second 5 Tiles

    1 runs w/ 3 tiles

    Runs with Three Colored Tiles in First 5:

    2 runs

    Second 5 Tiles

    2 runs w/ 3 tiles

    Runs with 4 Colored Tiles in First 5:

    6 runs

    Second 5 Tiles

    1 run with 1 tiles

    1 run with 2 tiles

    1 run with 3 tiles

    3 runs with 4 tiles

    So if we take the 3 runs where there were fewer than average colored tiles in the first 5 tiles, the average number of colored tiles drawn in the next 5 tiles is exactly 3. If we take the 6 runs where there were more than the average number of colored tiles drawn in the first 5 tiles, the average number of colored tiles drawn in the next 5 tiles is also exactly 3.

    Not nearly enough data to prove anything, but I found the excercise interesting and would welcome others doing 10 runs so we can combine the data.
     
  7. ArtNJ

    ArtNJ Well-Known Member

    Jul 13, 2009
    3,212
    29
    48
    New Jersey
    This looks quite likely given the results of the test I just ran in the post above, which found 73% of the first 10 tiles are colored tiles.

    I also observed the effect you described, with an 80% chance of a colored tile in the first 5 draws, and a 60% chance of a colored tile in the next 5 draws.
     
  8. BroonBottle

    BroonBottle Well-Known Member

    Jul 31, 2009
    90
    0
    6
    I don't know how this is happening but it seems the more I play, the worse I'm getting at it. Within the first day I had a couple of scores of 7500+ and was getting 3000+ on a frequent basis, and somehow I've gone downhill from there!!!!
     
  9. kamikaze28

    kamikaze28 <a href="https://itunes.apple.com/us/app/hundreds/

    You know your psychology and statistics. I'm really surprised by your findings to be honest. I would encourage anybody to lend their time and brainpower to support you in your endeavor while I remain on the drawing algorithm.

    Interesting theory, I should be able to show this based on the sequences I have. It could very well be that the number of white cards in the stack increases with the high card (6-24: 4 white cards, 48-96: 6 white cards, and so on and so forth) which would lead to the effect you described.

    Do you consider the 9 cards on the initial board? In order to keep the blue/red balanced, they would have to matter.
     
  10. JCho133

    JCho133 Well-Known Member

    Jul 27, 2012
    7,907
    27
    48
    I have a bug
     

    Attached Files:

  11. ArtNJ

    ArtNJ Well-Known Member

    Jul 13, 2009
    3,212
    29
    48
    New Jersey
    I did not consider the 9 cards on the initial board.

    The most interesting thing was definitely the high % of colored tiles, and also the fact that it appeared to decrease from tiles 1-5 to 6-10. More data is needed but I'm of the opinion that the % of colored tiles likely does decrease over time.
     
  12. y2kmp3

    y2kmp3 Well-Known Member

    Jun 25, 2010
    1,784
    3
    38
    #332 y2kmp3, Feb 11, 2014
    Last edited: Feb 11, 2014
    I love to see your findings. I think your drawing algorithm will also shred some light to my theory.

    Like you, I have observed some unexpected allocation of the blue and red tiles, though I did not do any experiment to find out.

    It is too bad that there is NO way to "REPLAY" the same game OVER AND OVER AGAIN to see if the sequence is altered. There is no undo button or a way to "save" a state to reuse it for an experiment. All of these trials, yours and mine, are thus subjected to the problem that the trials are operating on different parameters of the game which are presumed different and reset differently each time. Thus, any analysis (statistical or otherwise) cannot eliminate this potential fatal flaw, unless the developer can share openly the algorithm with which these tiles are derived. It is like reverse engineering a Pandora's box.

    In your algorithm, is it possible to try to model the distribution of the tiles by some mathematical models or statistical distribution (like a normal, Chisquare, or Bernoulli with high degree of kurtosis) and test for fitness of your model? By Occam's razor, I suspect that the developer must use some "simple" distribution or model to determine these tiles. The presence of a distribution function will indeed explain all of these observations that the tile appearances are being dynamically adjusted depending on what tiles are already on the board.


     
  13. JCho133

    JCho133 Well-Known Member

    Jul 27, 2012
    7,907
    27
    48
    #333 JCho133, Feb 11, 2014
    Last edited: Feb 11, 2014
    Haha guys look :D
     

    Attached Files:

  14. Scorpion008

    Scorpion008 Well-Known Member

    Jun 18, 2011
    602
    0
    0
    Ya there is. I can pm you how, it's legal but leads to easy cheating. Interested?
     
  15. Scorpion008

    Scorpion008 Well-Known Member

    Jun 18, 2011
    602
    0
    0
    Ok, so I have been very forthcoming with the fact that I did indeed hack the game. Well, to see how far I got, check the leaderboards. I have had 8 of all cards at the end of a given game. I have the highest non-cap score for the two main leaderboards. My friends are shaking in their shoes. Anyways, I would just suggest that the devs pick up their security before too many people figure this out. It was way to easy, to be honest, but could have been easier, so props for that (they put some security in place). I really think that the pseudo random entries in the plist file would suggest some helpful things to the mathematicians here. There are a finite number of them but a number greater than 1. Perhaps there are several random choices and one is randomly selected, rather than 3 known choices where one is randomly selected.
     
  16. y2kmp3

    y2kmp3 Well-Known Member

    Jun 25, 2010
    1,784
    3
    38
    I don't have a JB device. Will pass on this offer. ;)

    Also, even if you are able to hack a setup to get certain tiles, how can you be sure that those tiles can actually be achieved through normal play? Part of my question and other questions posted elsewhere is whether or not the tile allocation are dynamically skewed in certain way so to make sure that certain "progression" is astronomically difficult as to be practically impossible (which is NOT a desirable feature of a game). You can artificially put in two 768 tiles, but can the SECOND 768 tile be achievable by normal means? That is the question which needs to be answered.

    Regardless, you did the right thing by being upfront about the hack. I think your work is actually quite IMPORTANT in elucidating the underlying algorithms driving the tile allocation. I encourage you to continue to report your findings in this forum.

     
  17. Scorpion008

    Scorpion008 Well-Known Member

    Jun 18, 2011
    602
    0
    0
    I am not jailbroken; you don't need to be either. If you make a setup, you can copy the file at that point. You can then play the setup, record the results, and reboot the old setup and try it again. The thing I am not sure of is whether or not the algorithm can only do one thing at that point (aka, same result when you reboot the save) or if everything is random and created when needed.
     
  18. kamikaze28

    kamikaze28 <a href="https://itunes.apple.com/us/app/hundreds/

    Preliminary Card Draw Algorithm

    I think I've got it!

    Since sequences #2 and #4 were most promising, I went through them manually and marked where one stack ended and a new one was created based on my results so far. Except for one segment in sequence #4, it worked out perfectly. Here are my preliminary findings:
    • A fresh stack contains 12 basic cards: 4 blue (1s), 4 red (2s) and 4 white (all 3s).
    • At some point (based on the highest card, I suspect) bonus white cards are added (exclusively non-3s)
    • When a game starts, a stack is created (without bonus cards), shuffled and 9 cards are drawn from it to populate the initial board.
    • When the last card of a stack is drawn a new stack is created and shuffled and the process begins anew.

    I annotated both the formatted and raw sequences with | (yellow in the formatted case) to signify when a card draw depleted a stack and caused the creation of a new one. This pattern just fits too good to be wrong. Note that you can predict certain cards towards the end of a stack.
     
  19. Scorpion008

    Scorpion008 Well-Known Member

    Jun 18, 2011
    602
    0
    0
    #339 Scorpion008, Feb 11, 2014
    Last edited: Feb 11, 2014
  20. ArtNJ

    ArtNJ Well-Known Member

    Jul 13, 2009
    3,212
    29
    48
    New Jersey
    @kamikaze28-

    When it was thought that the sun and planets revolved around the earth, new observations continually posed problems. The model was adjusted again and again, creating various rotations/additional motions of the planets as they revolved around the earth.

    The problem, of course, was that they assumed the way things had to work, and kept adjusting and adjusting the model to try and fit the assumption as more and more data came in. It "worked" for a long while, as the model got ever more complex.

    By the way, have you examined your sequences to look at the declining frequency of colored tiles as the game progresses?
     

Share This Page