# Bagels - the digit gussing game.

**URL:** <https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797>\
**Category:** The Game Room\
**Created:** [October 13, 2008, 11:51pm UTC](https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797 "2008-10-13T23:51:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [October 13, 2008, 11:51pm UTC](https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797/1 "2008-10-13T23:51:22Z")

</div>

I was thinking of putting this in GQ but it’s probably better here.  
For the last 10 years, there’s been a game on my website [www.1728.com/digit.htm](http://www.1728.com/digit.htm) which is a version of a 25 year old computer game called Bagels. Anyway, I call mine “Digitally Correct” and you can choose to guess from 1 to 10 digits. There will never be any repeated digits so if you were to choose 10 digits, it would have _all_ the digits with no repetition. Yes, believe it or not, there’s a point to this.  
For increased “user-friendliness”, I recently rewrote the program and I started thinking about the 10 digit option. I used to think the only way to win at the 10 digit option would be if you were lucky enough to guess the only winning number out of the 10 factorial possibilities. (where 10 factorial = 3,628,800 - actually it would be less than that because the computer number never begins with zero).

So, a strategy then occurred to me that if you could find a 10 digit number that has _none_ of the digits in the order of the computer number, it would be a clue. For example, if you typed in “1234567890” and it had no matching digits then you’d know the computer number didn’t begin with 1, the second digit can’t be 2, and so on. Then, finding additional numbers, would narrow down the search even further.

For those of you that might still be awake, I wondered how many numbers could be found that had _all_ digits in the wrong place from the computer number. This reminded me of the “drunken sailor” problem in which a group of sailors go on liberty, get drunk and return to their ship choosing their cots completely at random. What are the odds that every sailor will be in the wrong cot? The answer is that as the number of sailors gets larger the probability approaches 1/e or about 36.79%. So, that means that if you have to guess a 10 digit computer number, you could find about 1,300,000 (10 factorial times .3679) numbers that have no matching digits with the computer number order.

Anyway, I was thinking of adding some of this information to my web page and I wondered if anyone here at the SDMB knew about any strategies for this.

Thanks. Oh, and this is my first posting in The Game Room. 🙂

---

<div class="post-metadata">

**Author:** ![Mbossa](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mbossa](https://boards.straightdope.com/u/Mbossa)\
**Post date:** [October 14, 2008, 12:40am UTC](https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797/2 "2008-10-14T00:40:16Z")

</div>

Afraid I can’t be too much help, but in case you didn’t already know, what you’re describing is derangement. Complete and utter [derangement](http://en.wikipedia.org/wiki/Derangement).

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [October 14, 2008, 3:22am UTC](https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797/3 "2008-10-14T03:22:02Z")

</div>

**Mbossa**  
Derangement - That’s _precisely_ what I’m talking about. I never knew it had a specific term attached to it so thanks for that information.

Now, I wonder if there is anything about derangements that would lead to a strategy for guessing a 10 digit number.

---

<div class="post-metadata">

**Author:** ![Projammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/projammer/32/559_2.png) [@Projammer](https://boards.straightdope.com/u/Projammer)\
**Post date:** [October 14, 2008, 7:26pm UTC](https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797/4 "2008-10-14T19:26:43Z")

</div>

Also a scaled up version of [Mastermind](http://en.wikipedia.org/wiki/Mastermind_game). Used to love playing that.

[Wikipedia](http://en.wikipedia.org/wiki/Mastermind_game) of original board game.

---

<div class="post-metadata">

**Author:** ![Sternvogel](https://avatars.discourse-cdn.com/v4/letter/s/bc79bd/32.png) [@Sternvogel](https://boards.straightdope.com/u/Sternvogel)\
**Post date:** [October 14, 2008, 8:10pm UTC](https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797/5 "2008-10-14T20:10:54Z")

</div>

Just tried it and took 37 steps – got 8 digits correct by guess #30, but took me a while to figure out _which_ two needed to be exchanged with each other! Just for the record, the sequence selected for me was 5192408637.

---

<div class="post-metadata">

**Author:** ![wolf\_meister](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolf_meister/32/15202_2.png) [@wolf\_meister](https://boards.straightdope.com/u/wolf_meister)\
**Post date:** [October 15, 2008, 4:00am UTC](https://boards.straightdope.com/t/bagels-the-digit-gussing-game/467797/6 "2008-10-15T04:00:44Z")

</div>

**Sternvogel**  
Congratulations !!!  
Since the game already had a choice for guessing 10 digits, I think I’ll add some information about guessing 10 digits, derangements, etc.  
And thanks for playing the game.
