Random Generator

From TetrisWiki
Revision as of 07:56, 4 January 2008 by (talk)
Jump to navigation Jump to search

The Random Generator is BPS's name for the algorithm used to generate the 工控机 茅台酒 二锅头 防伪标签 热转印机 水晶像 奖杯 干洗 数码快印 硒鼓加粉 塑料颗粒机 防伪 防伪技术 高新技术企业认定 北京洗衣公司 服务器机柜 空气净化工程 国际速递 国际快递公司 国际快递 梯具 节能节电 冬令营 石材翻新 电器维修 北京公司注册 制冰机 电脑回收 代开发票 不干胶 机打发票 电缆桥架 电缆桥架 北京货架 航空货运 会议服务 小升初 梅兰日兰UPS 口语 Dell服务器 再生塑料颗粒机 灯光音响 二手电脑回收 热水器维修 环氧地坪 IBM服务器 工商注册 IBM服务器 北京航空货运 北京写字楼 动画制作

sequence of tetrominoes in Tetris brand games that follow the Tetris Guideline.

Random Generator generates a sequence of all seven one-sided tetrominoes (I, J, L, O, S, T, Z) permuted randomly, as if they were drawn from a bag. Then it deals all seven tetrominoes to the piece sequence before generating another bag. There are 7!, or 5,040, permutations of seven elements, and it is believed that Tetris assigns a nearly equal probability to each of these, making it much less likely that the player will get an obscenely long run without a desired tetromino. It can produce a maximum of 12 tetrominoes between one I and the next I, and a run of S and Z tetrominoes is limited to a maximum of 4. Exception: In Random Generator as implemented in Tetris The Grand Master Ace, the first piece of the first bag is always I, J, L, or T, just as in the traditional TGM randomizer.

Despite the generic sounding name, presumed employees of BPS are known to treat the term "Random Generator" as a unique name, referring only to this particular algorithm.

While the number of tetrominoes in a single bag is usually 7, some games use a different number. The public beta of Tetris Online (Japan) used an 8-bag randomizer for the player. Not all guideline-compliant games use the Random Generator in all modes. Tetris Worlds and Tetris Green, for instance, use a different randomizer in their Square modes, and TGM3 uses the TGM randomizer even when the game is set to "World" mode.

Snake sequences

There are two "snake" tetrominoes, called S and Z. As only two snakes will be in a given bag, a sequence of more than two snakes must cross the "seam" between bags. The probability of the next two bags having a sequence of four consecutive snakes, the maximum possible, is 1/(7*6*7*6) for SZSZ and likewise for SZZS, ZSSZ, and ZSZS, for a total of 1/441. But the probability of these being your three next pieces are 1/441 times the probability of being at position 6 in a bag, so the probability of the next four pieces being SZSZ are 1 in 3087.

Define a "2|1 combo" as chosen sixth and seventh pieces in one bag and first piece in next bag, and a "1|2 combo" as chosen seventh piece in one bag and first and second pieces in next bag. Define a "snake" as the S tetromino or the Z tetromino.

The probability of any 2|1 combo (e.g. SZ|Z) is 1/(7*6*7) = 1/294. There are four different 2|1 combos containing all snakes (SZ|Z, SZ|S, ZS|Z, and ZS|S), so the probability of getting a 3-snake 2|1 in your next two bags is 4/294. But the probability of being at the sixth piece in a bag, where your next three pieces are a 2|1, is 1/7, making the probability of being at a three-snake 2|1 equal to 4/(294*7) = 2/1029. By symmetry, the 1|2 probabilities are exactly the same: 2/1029. So for Random Generator, this makes a 1 in 257 chance of your next three tetrominoes being snakes.

To do: compare with odds for TGM randomizer


See also