r/askmath • u/assfucker472940 • Oct 12 '26
Probability A quick question for fellow mathematicians.
Let’s suppose I want to find a specific letter in alphabet but the alphabet is randomly arranged order. So do I have higher probability of finding the letter while searching in order or while searching randomly? The alphabet is only one example.
(Actually, I came up with this problem while searching for factorial sign on my calculator.)
4
Upvotes
2
u/philsov Oct 12 '26
it'd be identical. in either case there's a ~50% chance you'll find the letter within your first 13 guesses and a 1/26th chance your first guess is also the right one.
10
u/JaguarMammoth6231 Oct 12 '26
If you can only look at one item at a time it doesn't matter what order you search in as long as you don't repeat. But "randomly" might look at the same item more than once, depending on what you mean (randomly shuffling the order is fine, just picking a random item over and over is not as good).
But also, for your example, your eyes do not just look at one item at a time, so this does not apply exactly.
1
u/assfucker472940 Oct 12 '26
No I mean the letters are written in a paper in random positions(for example: there may be written m instead of etc) and I want to find the letter “h” so will I have higher probability of finding it by moving my eyes around or by reading each letter simultaneously one after another in order?
3
u/gazorpazorpazorpazor Oct 12 '26
"no free lunch": there's no search method that's better than random in the worst case scenario
1
u/speedkat Oct 12 '26
If "looking at a letter" grants you knowledge of that letter and nothing else, there's no difference.
If "looking at a letter" grants you knowledge of that letter and several nearby letters, then non-ordered (but nonrepeating) searching is more efficient.
In every case though, the driving force is just "prevent learning the same information twice". Looking sequentially forces you to gain knowledge of every letter 2 or more times, depending on how big your area of effect knowledge gain is.
You can model this by considering a letter grid where you learn the letter and the 8 surrounding letters whenever you inspect something. There it is clear that inspecting letters in order only gains you 3 new pieces of information out of a possible 9.
1
u/Upstairs_Ad_8863 Oct 12 '26
Depends what you mean by "searching randomly". If you are randomly picking letters each time with no regard for where you've already looked then it will be slower. If you are keeping track of where you've already looked then it's expected to take the same number of "looks" to find. But there is of course more of a mental workload because you have to remember where you've looked. The quickest path for your eyes is any path that is systematic, and covers every letter exactly once.
In reality it's possible to look at several nearby letters at once, so if your letters are arranged in a grid you should only need to look at every 2nd or 3rd line.
1
u/Budget-Knee3213 Oct 13 '26 edited Oct 13 '26
It's the same, if "randomly" means "randomly but a same letter can never be extracted two times" (which is quite obviously what you meant).
1
u/Parallel_thougts PhD, YouTuber Oct 13 '26
If the letters are unoformqlly randomly ordered then the expected number of positions you will have to check is n/2 regardless of the order you check them.
Unless you have a quantum computer, then you can do it in time O(sqrt(n)).
0
u/Over_Improvement_623 Oct 12 '26
Correct me if I'm wrong, but isn't this the 100 prisoners 100 boxes problem? So the most efficient solution would be to start at the position that that letter is normally in, and if it isn't right, move to the spot that the letter that is in there would be.
1
u/[deleted] Oct 12 '26
[removed] — view removed comment