<> background

Original God is a two-dimensional game developed by MIHA you , Drawing cards is one of its core playing methods . On the card drawing probability and minimum guarantee mechanism of Yuanshen , There are a lot of detailed analysis on the Internet . So in the long run , Every time you get a five-star character , The five-star character happens to be in the current period UP What is the probability of ?

<> Detailed explanation of the minimum guarantee mechanism

The basic guarantee mechanism of the original God is as follows . If you've never drawn a five-star character before , The five-star characters drawn are 50% The probability of is the current period UP Five star character ,50% The probability is non current UP Five star character . If the non current period is drawn last time UP Five star character , It must be the current period when the five-star character is drawn this time UP Five star character , This is what we call a big bottom guarantee . If the current period was drawn last time UP Five star character , When you draw a five-star character this time, you will be treated as if you had never drawn a five-star character before .

<> Code and running results

C The language code is as follows .
#include <stdio.h> #include <stdlib.h> #include<time.h> int main() { int i
=0,j=0,up=0,down=0; int tmp=0;//0 It means that the first drawing or the last time triggered the bottom guarantee ,1 It means that the minimum guarantee was triggered last time srand(time(NULL));
for(i=0;i<10000;i++){// Ten thousand times j = rand() % 2; if(tmp==0){
if(j==0)up++;//j=0 Indicates that the current period is selected UP The role triggered the bottom guarantee else if(j==1){down++;tmp=1;} //j=1 tilted else
printf("warning!") ; } else if (tmp==1) { up++; tmp=0; } else
printf("warning!") ; }
printf(" Run 10000 times , Total current period UP%d second , Probability is %.2f, Non current period UP%d second , Probability is %.2f\n",up,up/10000.0,down,down/10000.0);
return 0; }
python The code is as follows
import random i,j,up,down=0,0,0,0; tmp=0;#0 It means that the first drawing or the last time triggered the bottom guarantee ,1 It means that the minimum guarantee was triggered last time for i
in range(10000): # Ten thousand times j = random.randint(0,1) if(tmp==0): if(j==0): up+=1
#j=0 Indicates that the current period is selected UP The role triggered the bottom guarantee elif(j==1): down+=1 tmp=1; #j=1 tilted else:
printf("warning!") ; elif (tmp==1): up+=1; tmp=0; else: printf("warning!") ;
print(" Run 10000 times , Total current period UP%d second , Probability is %.2f, Non current period UP%d second , Probability is %.2f\n"%(up,up/10000.0,down,down/10000.0));
give the result as follows ：
C： Run 10000 times , Total current period UP6672 second , Probability is 0.67, Non current period UP3328 second , Probability is 0.33
python: Run 10000 times , Total current period UP6673 second , Probability is 0.67, Non current period UP3327 second , Probability is 0.33

<> conclusion

Just every time , The probability of skew is 0.5, But with the minimum guarantee mechanism , The probability of skew is reduced to 0.33, This is a very humanized design , Krypton gold !

Technology
Daily Recommendation