Prime-Roll

点击此处获得更好的阅读体验


WriteUp来源

https://dunsp4rce.github.io/csictf-2020/miscellaneous/2020/07/22/Prime-Roll.html

by raghul-rajasekar

题目描述

We built a random number generator and it just rolls dice in the background and prints the result of the roll. We love prime numbers so a dice with (10^9)+7 (a famous prime number) sides is used. To simulate random behaviour, the machine rolls the dice n number of times, where n equals the 2((109)+7) (th) prime number. We want to know the probability of the largest result among all these rolls being a prime number too. You can stop the machine from rolling dices till the Heat Death of the universe by telling us the answer beforehand. Calculate the first 10 digits after the decimal place. The flag will look like -> csictf{first_10_digits_after_the_decimal_point}

题目考点

解题思路

Not sure what this question was about, but intuitively at least, if you roll a die many times, the probability of the largest number on the die appearing at least once tends to 1. Since the largest number in this case is 10^9 + 7 (which is prime), the probability of the largest result among all these rolls being a prime number also tends to 1 (something like 0.999999999999...). Thus, the first 10 digits after the decimal place are most likely 9999999999, without even calculating.

Flag

1
csictf{9999999999}