I will roll a random number between 1 and 1000. If the number is prime, I will select the prime option. I will choose the perfect square option if it is a perfect square. If it is a perfect cube, then I will choose the perfect cube option. But, if it is both a perfect cube and a perfect square, I will select only the 4th option (both a perfect square and a perfect cube). If it is neither of these, I will reroll the number.
🏅 Top traders
# | Name | Total profit |
---|---|---|
1 | Ṁ119 | |
2 | Ṁ117 | |
3 | Ṁ117 | |
4 | Ṁ84 | |
5 | Ṁ77 |
People are also trading
@ikirpichev your random number is: 17
Salt: 8ygdvd85pc7, round: 5017439 (signature b0d5ddb1982c090e3dd2b8add00bf52b20740f1dca997f2e1a0ab41cd76572b1819d6f4cb80de378b2bdc5c594a990f70d7066fe22f0a7e302280ee7d3c245db3cc47a93ef7c579fda82fd689d52b3f58c6402cd80e152c51a0b2c6e9da5235c)
@ikirpichev you asked for a random integer between 1 and 1000, inclusive. Coming up shortly!
Source: GitHub, previous round: 5017437 (latest), offset: 2, selected round: 5017439, salt: 8ygdvd85pc7.
@ikirpichev your random number is: 504
Salt: 9p8lmcckxci, round: 5017436 (signature 8182d52e117f3842354ff4fdd4321f0c76b39617e426f18fe940e395cf10a98d113e617cb5663e166249fb6df793ed740cc4ec8e8a1793798b36e1be20bace55fe7bafd63bab886f756677b6604f4ff25774be86bf58eb0b296a75ba07c6cca1)
@ikirpichev you asked for a random integer between 1 and 1000, inclusive. Coming up shortly!
Source: GitHub, previous round: 5017434 (latest), offset: 2, selected round: 5017436, salt: 9p8lmcckxci.
@ikirpichev your random number is: 768
Salt: p3ab6idgbsh, round: 5017433 (signature a874dc84ecc72ccce02940352848b9d9b5417232134c21935cdad3603763f420291ece7e54b1c0f07d77d7c6e20a0e5a026226a54ffeadf40e70823b93a11d422012685c24bf1c834752ff8fa069fbf98ed8bb21133d1a53bd47c5466ad3f79b)
@ikirpichev you asked for a random integer between 1 and 1000, inclusive. Coming up shortly!
Source: GitHub, previous round: 5017431 (latest), offset: 2, selected round: 5017433, salt: p3ab6idgbsh.
another stupid market with a correct answer.
Code:
N = 1000000
LOWER_BOUND = 1
UPPER_BOUND = 1000
import random
def is_prime(x):
if x == 1:
return False
if x == 2:
return True
i = 2
while i <= x ** 0.5:
if (x % i) == 0:
return False
i += 1
return True
def is_perfect_cube(x):
for i in range(0, round(x ** (1/3)) + 2):
if x == i ** 3:
return True
return False
def is_perfect_square(x):
for i in range(0, round(x ** (1/2)) + 2):
if x == i ** 2:
return True
return False
resultsDict = {"prime": 0, "perfect cube": 0, "perfect square": 0, "both": 0}
currentNum = random.randint(LOWER_BOUND, UPPER_BOUND)
for i in range(0, N):
currentNum = random.randint(LOWER_BOUND, UPPER_BOUND)
while not is_prime(currentNum) and not is_perfect_cube(currentNum) and not is_perfect_square(currentNum):
currentNum = random.randint(LOWER_BOUND, UPPER_BOUND)
if is_prime(currentNum):
resultsDict["prime"] += 1
if is_perfect_square(currentNum) and is_perfect_cube(currentNum):
resultsDict["both"] += 1
else:
if is_perfect_cube(currentNum):
resultsDict["perfect cube"] += 1
if is_perfect_square(currentNum):
resultsDict["perfect square"] += 1
print(resultsDict)
print("Percent both prime and perfect cube: " + str(resultsDict["both"] / N))
print("Percent prime: " + str(resultsDict["prime"] / N))
print("Percent perfect square: " + str(resultsDict["perfect square"] / N))
print("Percent perfect cube: " + str(resultsDict["perfect cube"] / N))
Result:
Percent both prime and perfect cube: 0.014431
Percent prime: 0.81612
Percent perfect square: 0.135715
Percent perfect cube: 0.033734
Fair values (more or less, I don't care):
Prime: 81.6%
Perfect square: 13.5%
Perfect cube: 3.3%
Both perfect square and perfect cube: 1.45%
Exact numbers if anyone's wondering:
168 primes
28 squares (no cubes)
7 cubes (no squares)
3 square and cubes
206 total