Renamed all folders

This commit is contained in:
2021-04-16 16:58:48 +02:00
parent dbc6cfef05
commit 197b3eea8a
62 changed files with 0 additions and 0 deletions

40
053/main.py Normal file
View File

@@ -0,0 +1,40 @@
'''
There are exactly ten ways of selecting three from five, 12345:
123, 124, 125, 134, 135, 145, 234, 235, 245, and 345
In combinatorics, we use the notation,
.
In general,
, where , , and .
It is not until , that a value exceeds one-million:
.
How many, not necessarily distinct, values of
for , are greater than one-million?
'''
# Okay I have to admit that it looks really bad without the math equations
import time
import math
def main():
print("Hello, this is Patrick")
t0 = time.time()
tooBig = 1000000
counter = 0
for n in range(1, 101):
for r in range(1, n+1):
if math.comb(n, r) > tooBig:
counter += 1
print(counter, time.time() - t0)
if __name__ == "__main__":
main()