6 ms·
Question: "How many computable numbers could a computer compute if a computer could compute all computable numbers?" Woodchucks are curious about this.
by photochemsyn 5y ago
Question:
"How many computable numbers could a computer compute if a computer could compute all computable numbers?"
Woodchucks are curious about this.
- jazzyjackson 5y agoI wanted to incorporate this question with an Arduino lesson plan based around key breaking, basically demonstrating that 10,000 combinations might seem like a lot when you're doing it by hand, but a computer can brute force it in no time, so how big does a number have to be before it starts taking serious time for a computer to count to it? That's when I learned compilers will look at your for loops and just predict the result of incrementing a number a million times and skip to the end condition. Was quite a shock to find out the program I write is not the program that runs. I think I added something simple to the loop, like flipping a bit on a digital output to force the loop to actually run.
- tsimionescu 5y agoThe best way to achieve this without changing the code would be to modify the variable to be `volatile`. That way you tell the compiler that you actually care about it reading/writing it from/to memory every time it is read/written.
- kamray23 5y ago-O0 turns off optimizations on most reasonable C compilers.
- lordnacho 5y agoStick random() in there somewhere for each iteration, print it out? Then the optimizer won't be able to just jump to the end.
- jazzyjackson 5y agoActually yes I think that was what we went with, instead of counting from 0 to MAX_INTEGER we generated random numbers that many times, brute forced integer "keys" just fine.
- sumtechguy 5y agoYou owe the oracle 32GB of RAM. His game rig is low on memory and hungry.
- tshaddox 5y agoCountably many!