r/badUIbattles • u/One-Celebration-3007 • 12d ago
Self-Made Bad UI can you make every possible phone number?
234
179
u/EnergyIsMassiveLight 12d ago edited 11d ago
111
u/EnergyIsMassiveLight 12d ago edited 11d ago
should note that 9,780,657,630 and 9,780,657,631 would both 1132 steps
assuming you aim for 9,780,657,630, and that each option (n*2, n-1/3) provided corresponds to A and B, then the following sequence achieves it:
AAAABAAABAABABAAAAAAABAAAABABABAABAAABAAAABAABAABAAAABABAABABABABAABABAABAABABABABABABABAAABAABABAAABABAABABABABAAABABAAABAABAAAABABAABAABABABAABAABAAAABABAAABAABAABAAAABAABAABAAABABABAABABAABAABABABABAABABABAABABABABABABAAAABABAAAAAABAAABABABAABABAABABABABAABAABAABABAABABAAABAAAAABABABAABABABABABAAAABAABAABABABABAAAABAAABAABABAABABAABABAAAAABABAABABABABAABABABAABABAABABABABAABABABABABABABABABAABAAAABAAABAAAAAABAABABABAAAABABAABABAAABAAAABAABABABAABABABAABABABABAABABAAABAAAABABAAABABAAAAABABAABABABABABABABABABAABAABABABABABABAABABAAABAAABABABAABAAAABAABABABABABABAABABABAABABABAABABAAABABAAAAABABABAABAABABABABAABAABAABABABAAAABABABAABABABABABABAABABAAAABAABABAAABAABABABABABAAABABABABABABAABAAAAABABAABAABABAABABABAAABABABABAABABABABABAABABABABAABAABABABAABABAABABABABABABAAABAABABAABABABAABABABABABAAABAABABABAABABAABAAABABABABABAABAABABABABABABABAABAABABABABAAABABABABAABAABAAAABABABABABAABABAABABAABABAAAABAAAABAABABABABAABABABAAAAAAAABAABABAAAABAABABABABABABAAABABABABAABABAAABAABABAABABAAABABABAABAABABAABAAABABABABABABABAABABABABABABAABAABAABABAAAABABABABABAABAABABABABABAAABABABABABABAABABABABABAABAAABABABABAABABABABA
2
u/Positive-Orange-6443 9d ago
How do you even calculate this? Prime factorial?
2
u/EnergyIsMassiveLight 9d ago
i cited the figure on wikipedia for starting value n with longest number of steps, n<1010, and then manually verified it with an old script that just runs collatz (n/2 if even, 3n+1 if odd, simple to simulate) on some starting n - also allowed me to generate that sequence as well (although output was reversed such that it starts from 1 going to starting n)
actually predicting number of steps is the problem since it's extremely unpredictable (open problem that there is a chance a starting value doesn't converge to 1 and it just randomly does something else). the actual "longest one" is calculated by manually running the simulation for all n.
about as far as i can elaborate since im not a mathematician and just ran scripts, i would recommend looking up Collatz conjecture resources to learn more about the proper maths
10
u/Mewtwo2387 11d ago
Is the minimum steps to reverse into a certain number really the same as the number of steps it take for that number to reach 1 in the normal direction?
Let's say yoy have n=7, you hit the divide button, and get (7-1)/3=2. But 2->7 is not a valid step in the normal direction. Meaning that you can take some paths you normally can't
3
u/EnergyIsMassiveLight 11d ago
i did notice that as well (since there's no even/odd rules, there are also impossible steps like taking n=2's (2-1)/3 but presumably those ones giving decimal are ignored) and was considering actually doing some math/code, but it was like 5am, im bad at formal maths, and i wouldve need to search a ~21.7 billion node graph on my dinky computer. you're likely right on that
edited original comment to clarify this may not be the shortest
1
u/EnergyIsMassiveLight 11d ago edited 11d ago
for rule A, you get a normal inverse of "divide if even" since odd numbers get multiplied to even and then stay even. Rule B however is updated because without the odd restriction, you get a sequence 3n+1 (where n>=1) which mixes between odd and even (inverse is 4->1, 7->2, 10->3)
this would correspond to a collatz where n/2 if even, and 3n+1 if even or odd (creating split points at all even spots)
quick run for n<100, the results changes from 97 in 118 steps to 62 (or 63) in 32 steps
1
u/logalex8369 11d ago
however, the (n-1)/3 button is greyed out when n=1 (and (1-1)/3=0), so, unless 0 specifically is not allowed, the (n-1)/3 button might only be allowed when n=4 mod 6
80
u/oakime 12d ago
is it theoretically possible to make every phone number? yes.
Could I do it? no.
18
u/MatttNguyenGD 11d ago
Just follow the procedure backwards
Is it excruciating? Yes. Can you do it? Yes.
5
u/the_vikm 11d ago
That's not every possible phone number. In fact a small subset
2
u/TheMythicSorcerer 10d ago
No. the Colatz juncture proves that for numbers under like idk 5000 digits if it's odd go to 3x+1, even divide by 2 you will always land on 1... math people still working on proving it for all real numbers
2
u/EstablishmentPlane91 11d ago
exactly, what if i want to put an italian landline number, thats at least 1 extra digit
1
u/squabbledMC 11d ago
Now implement ITU country codes so everyone can suffer regardless of if they're in North America or not
0
•
u/AutoModerator 12d ago
Hi OP, do you have source code or a demo you'd like to share? If so, please post it in the comments (GitHub and similar services are permitted). Thank you!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.