Perfect Clears

Started by theRealMadridcf, March 05, 2017, 11:57:03 AM

Previous topic - Next topic

MrTSpin

#15
So if your hold piece is not a S,Z,I, or O than there is always a solution and if there is  an S,Z,I,O in hold then there is a 99.889% chance of a solution
_______________________________________________________________________
https://www.youtube.com/channel/UCTFfYnPuiblDARubTr7_UEA
https://www.twitch.tv/mrtspin

theRealMadridcf

Quote from: farter
great!
i can't come up with words to show my respect to this work (my English is not good enough).. because this just has solved one of the biggest fundamental problems in guideline tetris players' mind...

also optimization techniques mentioned are very inspiring as i'm also a programmer.

but then it comes my shameless additional feature request (slap

as we all see, in most official versions, the number of preview pieces shown is usually 1, 2, 3, or 6, but not 10. it brings further restriction that we only see the current piece + hold + the next N of the next pieces.

so.. how many sequences are solvable when only N previews are available, in other words, to make a decision based on 1+1+N pieces so that it's PC-able for all possible patterns after N pieces? (further, to choose a position maximizing the possibility)

Thank you for the nice words. It took a lot of effort to make the program so it's always nice to hear if someone is interested in it.

Solving that question is probably much harder because there is much more unsolvable sequences if you can't see all next pieces. Now I don't have time to try to solve it but maybe someone else wants to try?


Quote from: Ethereal_Intellect
Well, i guess i'm coming back to this years later with new knowledge (in a few weeks when i have more time)

I originally posted a few unsolvable (without hold) sequences back in
http://harddrop.com/forums/index.php?showt...4068&st=105

(4-6) - 8 Unsolvable sets found
123567 1256 // translated as IJLZOS IJ ZO
123567 1257 // translated as IJLZOS IJ ZS
123567 1267 // translated as IJLZOS IJ OS
123567 1356 // translated as IJLZOS IL ZS
123567 1357 // translated as IJLZOS IL ZS
123567 1367 // translated as IJLZOS IL OS
123567 2567 // translated as IJLZOS JZ OS
123567 3567 // translated as IJLZOS LZ OS

I'll try and make a newer more optimized version or use yours as a template or even piece of it.
And just so I didn't miss the answer anywhere, we still don't know if it's possible to perfect clear forever right? (In a random official game like Tetris Friends on facebook)

I mean some sequences are unsolvable (those 55 you mentioned) but i didn't notice if there was yet an analysis of an algorithm that prepares in advance for their possibility and brings over a hold from a previous bunch to purposely break and prevent them.

I also started with similar approach by solving sequences without hold. However, it is much slower because you have to try all possible piece placements to determine that a sequence is unsolvable. By using hold almost all sequences are solvable and therefore with a good heuristic algorithm you can quickly find the solution and move to next sequence.

You didn't miss the answer, no one has solved the question of perfect clearing forever, as far as I know. It isn't solved even when all the next pieces are shown for the rest of the game.

Btw, those 55 were just the half of unsolvable sequences with deep drop. The number of unsolvable sequences with soft drop and kicks is much higher: 62,834.

Quote from: MrTSpin
So if your hold piece is not a S,Z,I, or O than there is always a solution and if there is  an S,Z,I,O in hold then there is a 99.889% chance of a solution

99.88975% is the percentage of non pc'able sequences out of all sequences (S,Z,I,O in hold). It isn't the probability though. Some sequences are more likely to occur than others. This is because of two reasons:

1. The number of remaining pieces in bag #1 affects the number of possible sequences and therefore it affects also the probability of a certain sequence.
2. Some sequences can occur with multiple different number of remaining pieces in bag #1.

Examples:
1. When there are 7 pieces left in the bag #1, there are 7,408,800 different possible sequences. Therefore the sequence (I)IJLOSTZZTS can occur at a random situation with probability
1/7*1/7408800 = 0.000001928% = 1.92*10^(-8)
Similarly when there are 5 pieces left in the bag #1, there are 44,452,800 different sequences. The sequence (I)IJLOSSOLJI can occur at a random situation with probability
1/7*1/44452800 = 0.000000321% = 0.32*10^(-8)

2. The sequence (I)IJLOSTZIJL can occur when the number of pieces left in the bag #1 is 7, 6, 5, 4, 3, 2 or 1. Therefore the probablity for it to occur at a random situation is
1/7*(1/7408800 + 1/29635200 + 1/44452800 + 1/29635200 + 1/7408800 + 1/10372320 + 1/10372320) = 0.000007896% = 7.90*10^(-8)
The sequence (I)IJLOSTZZTS can occur only when there are 7 pieces left in the bag #1 and therefore it has lower probability (1.92*10^(-8)).


It might be surprising that some sequences can occur with almost 25 times greater chance than some other sequences. (7.90*10^(-8) vs 0.32*10^(-8))