Programming
A Tale of 2 Secrets › Forums › T.E.M.P.E.S.T. › Programming
Tagged: #answer
- This topic has 30 replies, 9 voices, and was last updated 2 days, 6 hours ago by ByteInBits.
-
AuthorPosts
-
12th October 2025 at 6:13 pm #110029Guest
17th Century solution for @ByteInBits question #107489.
>A number is chosen at random from the first 100 positive integers.
>What is the percentage probability that the chosen number is not divisible by 3, 4, or 7?We’ve modified one of Joseph Marie Jacquard’s loom head contraptions to perform this calculation. We take a card with 100 positions marked and devised a mechanism to punch holes in rows, marked ‘X’, every third, fourth and seventh mark along the card. The areas marked ‘-‘ are left unpunched.
–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X-
—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X
——X——X——X——X——X——X——X——X——X——X——X——X——X——X–We then feed this card back into the Jacquard head where we have devised an additional mechanism to punch a hole, along a new line, if none of the holes in the three original rows are punched.
–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X–X-
—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X—X
——X——X——X——X——X——X——X——X——X——X——X——X——X——X–XX–X—-XX-X—X-X–XX-XX–X-X–X–XX–X-X–XX–X–X-X–XX-XX–X-X—X-XX—-X–XX-XX–X—-XX-X—
We thereby arrive at the answer, by counting the number of punched holes. This indicates that the numbers, from the first 100 positive integers, not divisible by 3, 4, nor 7 is 42 out of 100 (42 %). Once set up, we can perform the ‘calculation’ in under two minutes.
14th October 2025 at 1:00 pm #110428ByteInBitsParticipant@John_Musgrave
Well I don’t have that contraption, sorry equiptment, so I can’t check its validity đ22nd October 2025 at 8:39 pm #111843ByteInBitsParticipantNo answers posted for post #107505 ?
Anyone out there willing ?23rd October 2025 at 12:08 am #111866F6EXB_the_frenchyParticipant@ByteInBits
#107505
Answer the following:
1] At what numbered marker and after how many minutes will all the studs line up? ===> 19th stud and after 6 mn.
2] If we let it run on, then after how many minutes will have passed when they line up again? ===> 30 mn.
3] Will the studs always all line up every 30 minutes? [YES/NO]===> YES (30 is the LCM of 3, 2, 1 and 5).
4] Using the initial data is it possible for the studs to all line up on any other marker? [YES/NO]===> NO
Many thanks to my friend Excel.23rd October 2025 at 5:59 pm #111870F6EXB_the_frenchyParticipant@ByteInBits
#107505I would like to add to my answer No. 4:
Every 30 minutes, the studs are aligned and are located on the same radius of the circle.
However, they can also be aligned on the same diameter. For example, at minute 21, they are at marks 4, 19, 4, 4, and this occurs every 30 minutes.24th October 2025 at 7:57 pm #112015Gen_ruiktParticipantJust a question are you allowed to use external sites to decipher the ciphertext but it makes you figure everything out similar to the tool that we are given
The rule is that you can use tools like word processors, text editors and spreadsheets, or the tools provided here on the site. Anything else you have to build for yourself. Hope that is clear but do ask if there is anything specific you have in mind.
Best wishes, Harry
28th October 2025 at 11:20 am #112021Gen_ruiktParticipantalso do you recommend any tools i can use for columnar transposition ciphers
When I started I used pen and paper, but you might find putting the text into a spreadsheet helpful. You will have to think about how to get the text into the cells the way you want, but once you have done that you can rearrange the columns easily. A more sophisticated approach is to learn to use grep in a text processor like BBEdit. You can get it to do things like replace characters matching a pattern, re-order strings and so on! Harry
28th October 2025 at 11:22 am #112018Gen_ruiktParticipantThanks ive been looking at something called [Edited by Harry] can you see if that is ok maybe?
That is a good example of something that would break the rules and won’t really help you later one, especially with the final challenge. You are much better off honing your own skills by developing tools and work streams for yourself. That might slow you down as a beginner, but it will make you much better equipped later on. (Which is the entire point of our rules!)
28th October 2025 at 3:20 pm #112112Gen_ruiktParticipantCheers harry for letting me know
29th October 2025 at 3:32 pm #112139Gen_ruiktParticipantI know its not relevant to this forum but i dont know where else to put it
Is there anyway to remove people from a team without disbanding the team because my teamate joined at week 2 but has not contributed to any answers and has gone inactive
But if i disband the team i lose all of the points i have earnedThe short answer is no! Individuals can choose to leave a team, but no-one else can make them. This is for, I hope, obvious reasons! The good news is that if you have been paying attention you will know that challenge 1-3 are all practice rounds so the points don’t count towards the final standings on the overall leaderboard. This means that if you (or anyone else) would now like to compete on your own or with a different team grouping then you are free to set up a new account and a new team and take part in Challenges 4-10 using that. It would be kind (and entirely in the spirit of the competition) to delegate the captaincy of your old team to one of its members so they can choose to continue with that team if they wish. The team captain can do that from their account page on the team tab. Hope this is clear, but do post if not. Harry
29th October 2025 at 9:40 pm #112145ByteInBitsParticipant@F6EXB_the_frenchy
Re: Markers and StudsThe answers you gave in your post #111866 are all correct.
Though at 2] 36 mins is what I was looking for (because 6 mins already lapsed)Your second post #111870 is not valid, they are not all ‘lined up’ at a specific marker
although they are as you say ‘in line’ across the diameter.30th October 2025 at 11:27 am #112155ByteInBitsParticipantI haven’t checked this, but it looks intriguing! Is it right and can you verify it? Harry
\\\\\\\\\\\\\\\\\\\\ Special 4 digit primes \\\\\\\\\\\\\\\\\\\
The prime 3137 is a special prime in that if each digit is removed from the left
a prime still remains thus 3137, 137, 37, 7 all are prime numbers, furthermore
if each digit is removed from the right thus 3137, 313, 31 and 3 all are prime.Write code to find the only other 4 digit number having this same property.
(Avoid any 4 digit numbers containing zeros)Post your code and its answer for all to see
31st October 2025 at 7:51 pm #112183F6EXB_the_frenchyParticipantCorrecting the message #112180:
I have only another one number with the property, because 1 is not a prime number.min = 2113 max = 7777 ########################## nombres premiers< 1000 ################################## liste_1000 = [] for n in range(1,999): if n > 1: for i in range(2,n): if (n % i) == 0: break else: liste_1000.append(n) print("liste des premiers < 1000 :\n", liste_1000 ) ########################## nombres premiers de 1000 Ă 9999 ################################## liste = [] for n in range(min,max + 1): if n > 1: for i in range(2,n): if (n % i) == 0: break else: liste.append(n) print("\nliste des premiers < 9999\n", liste) ########################## nombres premiers spĂ©ciaux ################################## liste_finale = [] for i in range(len(liste)): nombre = (liste[i] ) nombre = str(nombre)#; print("nombre : ", nombre) if int((nombre[0:1])) in liste_1000 and int((nombre[0:2])) in liste_1000 and int((nombre[0:3])) in liste_1000 and int((nombre[1:4])) in liste_1000 and int((nombre[2:4])) in liste_1000 and int((nombre[3:4])) in liste_1000: liste_finale.append(nombre) print("premiers spĂ©ciaux : ", liste_finale)31st October 2025 at 7:51 pm #112184F6EXB_the_frenchyParticipant>>> %Run ‘est premier_copie.py’
liste des premiers < 1000 :
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]liste des premiers < 9999
[2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221,….
premiers spĂ©ciaux : [‘3137’, ‘3797’]
>>>31st October 2025 at 9:52 pm #112187ByteInBitsParticipant@F6EXB_the_frenchy
Bravo, vos nombres premiers spéciaux sont corrects.
(Pourquoi avez-vous inclus les nombres premiers à moins de 4 chiffres ?)Well done your special primes are correct
(why did you include the non 4 digit primes?) -
AuthorPosts
- You must be logged in to reply to this topic.