## Monty Hall puzzle

## Monty Hall puzzle

(OP)

I am looking for the Monty Hall puzzle I saw it about two week ago but could not find it last week. It has a puzzle in it about bases. Can someone give me the link to the Thread please.

Never give up never give in.

There are no short cuts to anything worth doing

## RE: Monty Hall puzzle

A "Monty Hall" puzzle has to do with having 3 choices and being given the option to change your choice after a wrong door is revealed. Exactly like the Game Show - Let's Make a Deal which had the host Monty Hall.

I can't imagine a relationship to bases.

The Monty Hall scenario is quite storied in that most (in my experience) people cannot/will not accept the probability of winning increasing (doubling) if you change your choice after the reveal.

**********************************************

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

Indeed, many highly-respected and highly-qualified mathematicians refused to accept the correct answer when the problem was publicised by Marilyn vos Savant back in erm ... (fx: google) ... 1990

## RE: Monty Hall puzzle

Chris.

Indifference will be the downfall of mankind, but who cares?

Time flies like an arrow, however, fruit flies like a banana.Webmaster Forum

## RE: Monty Hall puzzle

I've been having some success convincing people with the following description.

Delay the door reveal

Offer the contestant the option to either stick with their first choice or have the best prize from the other 2 doors

Now it is obvious that 2 doors are better then 1 when the choice needs to be made

The reveal of the dud door is meaningless in this context and is more easily demonstrated to be meaningless regardless of when it is revealed.

**********************************************

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

## RE: Monty Hall puzzle

Never give up never give in.

There are no short cuts to anything worth doing

## RE: Monty Hall puzzle

I thought you meant recently!!!

That was one of my posts actually and I done goofed when I recreated it from memory.

It was in the Squaring the circle forum - thread1229-1601460: Interesting Probability Puzzle

The part you are refering to is posted on 26 Apr 10 14:10

The actual sequence should be:

15, 16, 17, 21, 23, 30, 33, 120, ???

**********************************************

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

It does not matter whether the dud door is revealed or not before the choice if you are offered the best choice of the 2 remaining 2 doors

In the classic game where the reveal is before the choice you are actually being offered the best of both but natually you wont take the one known to be a dud.

There is a 1/3 chance that both are duds but you play the odds, you take your chances, it's still best to switch.

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

Ah, that was a fun thread.

## RE: Monty Hall puzzle

Oh, not disagreeing at all. Just needed to make sure I could see it was the exact same problem. And it is!

## RE: Monty Hall puzzle

So number "base" not actual 'bases' then, :)

Chris.

Indifference will be the downfall of mankind, but who cares?

Time flies like an arrow, however, fruit flies like a banana.Webmaster Forum

## RE: Monty Hall puzzle

Never give up never give in.

There are no short cuts to anything worth doing

## RE: Monty Hall puzzle

15 in base 10 gives 15 (15)

15 in base 9 gives 16 (9+6)

15 in base 8 gives 17 (8+7)

15 in base 7 gives 21 (14+1)

15 in base 6 gives 23 (12+3)

15 in base 5 gives 30 (15+0)

15 in base 4 gives 33 (12+3)

15 in base 3 gives 120 (9+6)

15 in base 2 gives 1111 (8+4+2+1)

Again thanks for all who helped

Never give up never give in.

There are no short cuts to anything worth doing

## RE: Monty Hall puzzle

1111, 120, 33, 30, 23, 21, 17, 16, 15, 14, 13, 12, 11, 10, F, F, F, F, ....

It would be too obvious. 1111 is a strong hint and F of course is disclosing, that it's not all base 10 numbers.

But even only revealing from 120 to 10, the part of the sequence just decrementing would give a hint.

And finally, if you only reveal the part from 17 to 10, Occam's razor would suggest the sequence is simply a countdown.

Bye, Olaf.

## RE: Monty Hall puzzle

When I first encountered this puzzle, I had to look up the answer

I thought it was interesting enough to remember it but I disagreed strongly with the full answer.

The final number offered in the sequence as part of the answer was: 111111111111111

Personally I have several arguments as to why 15 one's is not continuation of the previous numbers but I'm curious if you would accept that number.

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

In regard to 111111111111111: http://en.wikipedia.org/wiki/Unary_numeral_system

The unary system is fitting in one aspect - it only has one digit, no matter if it's 1 or |. But it differs in not being a positional system and for that matter doesn't fit into the sequence. If you'd want to retrofit the unary system into a positional system, where a position of a digit in a number has a weight or base value you multiply with a digit, you'd need to define the weight of each position as 1^position and since 1^N is 1 no matter what N is, even for N=0, all positions would have the same weight of 1. So far so good. But as said already all normal positional systems have a factor for each position, the digit, going from 0 to N-1. For base 1 this would mean the one digit wouldn't be 1 but 0. But 0 as a factor would mean you could only represent the number 0 and so the unary numeral system doesn't fit into the sequence of positional numeral systems. We all know a but more complex extensions of the unary numeral systems by the roman numbers, having several abbreviations for larger numbers, that of course are not handy with just one digit. If you accept there is no 0 in the system it retrofits in that aspect, too, but I am with you the sequence ends (or starts) with 1111 in base 2.

Bye, Olaf.

## RE: Monty Hall puzzle

Never give up never give in.

There are no short cuts to anything worth doing

## RE: Monty Hall puzzle

The strongest argument in my mind this one:

I would have said it differently but I like your way better.

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

Never give up never give in.

There are no short cuts to anything worth doing

## RE: Monty Hall puzzle

Never give up never give in.

There are no short cuts to anything worth doing

## RE: Monty Hall puzzle

At first I thought it's a trick question perhaps, as larger numbers might grow and therefore have infinite persistence, but at max an N digit number has N 9s and 9^N<10^N, any other composition of digits will be even smaller, therefor there always will be a tendency towards smaller numbers with of course less digits. Aside of that you always get straight to 0 once any digit is 0. Therefore you can assume even a brute force calculation will not take long.

I wrote a small routine for CrossProduct and stored already computed values to reduce costs for repeated numbers.

Starting from 78, being too lazy to think of a higher start value, it took 632 computations and in split seconds I arrived at

## Hidden:

I'll not show VFP code here, maybe I'll translate that to C#, C++ or anything else more commonly understood later, if it is of any interest at all.

Bye, Olaf.

## RE: Monty Hall puzzle

Not saying your answer is wrong but there is nothing to indicate it couldn't be lower.

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

## CODE

A Maintenance contract is essential, not a Luxury.

Do things on the cheap & it will cost you dear

## RE: Monty Hall puzzle

The next level answer is

## Hidden:

After that is

## Hidden:

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

>why did you assume it would be a number higher than 77?

Assume there is an n<77 with Persistence(n)=6. Since Persistence(n) = Persistence(Crossproduct(n))+1 at least for n>9 -

_{and Persistence(n)=0 for n<10}- there would need to be an m = Crossproduct(n), so that Persistence(m) = 5. Also m would need to be smaller than n, since m = Crossproduct(n) and Crossproduct(n)<n for n>9. m < n < 77 can't be true at the same time Persistence(m) = 5, since 77 is the smallest number with Persistence 5. There can't be such an m and so the smallest number with Persistence 6 must be higher than 77. I think you can proof by induction this also is true for any following smallest number of Persistence x.Besides, Crossproduct(n) = Crossproduct(n div 10)*(n mod 10), which allows to define crossproduct recursive and lookup results already computed instead of computing them.

Bye, Olaf.

## RE: Monty Hall puzzle

>why did you assume it would be a number higher than 77?

Assume there is an n<77 with Persistence(n)=

5. Since Persistence(n) = Persistence(Crossproduct(n))+1 at least for n>9 - and Persistence(n)=0 for n<10 - there would need to be an m = Crossproduct(n), so that Persistence(m) =4. Also m would need to be smaller than n, since m = Crossproduct(n) and Crossproduct(n)<n for n>9. m < n < 77 can't be true at the same time Persistence(m) =4, since 77 is the smallest number with Persistence4. There can't be such an m and so the smallest number with Persistence5must be higher than 77. I think you can proof by induction this also is true for any following smallest number of Persistence x.## RE: Monty Hall puzzle

Yeah, when I started working on my own solution, the answer to my question became readily obvious. It seems rather stupid in hindsight in fact. I blame the fact that I've done too many puzzles over the years that I never let assumptions get in the way. This particular puzzle is the sort of thing I've seen at the Euler project. They would as for the lowest number with a persistence of 12 or so though.

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

It won't take much longer to compute persistences for the smaller numbers, anyway, so thinking about this proof will take much longer than simply computing persistences for 1 to 76, too, despite thinking about that problem you dive deeper into the problem and get to a more elegent and less brute force attack which Euler is often needing. The code I did is needing a minute to compute smallest number of persistence 8, I wonder if I could get to 12 at all with normal integers, you'd have to introduce using string math at some point. you can define a cache or eg a C# Dictionary for already computed solutions and lookup them, then you can get much higher. In regard of crossproduct you can strike out any 1, don't need to analyze and number containing a 0, and you can sort the digits of numbers to map very many numbers to a lowest number you only need to put into that cache/dictionary instead of all other with same crossproduct. Just some ideas to get to the 12th Persistence.

Bye, Olaf.

## RE: Monty Hall puzzle

^{233}.## RE: Monty Hall puzzle

A Maintenance contract is essential, not a Luxury.

Do things on the cheap & it will cost you dear

## RE: Monty Hall puzzle

Long time no see.

12 was simply a guess, I'm impressed that I was at least close

What's most important is that you realise ... There is no spoon.

## RE: Monty Hall puzzle

^{233}. The on-line encyclopedia of integer sequences says in its comments to sequence A014553 thathttp://oeis.org/A014553

## RE: Monty Hall puzzle

http://www41.homepage.villanova.edu/robert.styer/M...

## RE: Monty Hall puzzle

Due to memory restrictions you get an OutOfMemory Exception for trying to compute the lowest number of persistence 9, though that doesn't leave the int/int32 value range, but either the persistences or the crossproducts dictionary gets too large. So I hard coded 8 (highlighted in red) as the destination for the persistence.

## CODE --> c#

`using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LowestNumberwithPersinstence { class Program { public static Dictionary<int, int> Persistences = new Dictionary<int, int>(); public static Dictionary<int, int> CrossProducts = new Dictionary<int, int>(); static void Main(string[] args) { int lnNumber, lnPersistence, lnMaxPersistence; DateTime t0 = System.DateTime.Now; lnNumber = 0; lnMaxPersistence = 0; while (lnMaxPersistence < 8) { lnNumber++; lnPersistence = Persistence(lnNumber); lnMaxPersistence = lnPersistence > lnMaxPersistence ? lnPersistence : lnMaxPersistence; } Console.WriteLine(lnNumber); Console.WriteLine(DateTime.Now - t0); } private static int Persistence(int tnNumber) { int lnPersistence, lnCrossProduct; lnPersistence = 0; if (tnNumber > 9) { if (Persistences.ContainsKey(tnNumber)) { lnPersistence = Persistences[tnNumber]; } else { lnCrossProduct = tnNumber%10==0 ? 0 : CrossProduct(tnNumber/10) * (tnNumber%10); lnPersistence = lnCrossProduct > 9 ? Persistence(lnCrossProduct) + 1 : 1; Persistences.Add(tnNumber, lnPersistence); } } return lnPersistence; } private static int CrossProduct(int tnNumber) { int lnCrossProduct; if (tnNumber > 9) { if (CrossProducts.ContainsKey(tnNumber)) { lnCrossProduct = CrossProducts[tnNumber]; } else { lnCrossProduct = tnNumber%10==0 ? 0 : CrossProduct(tnNumber/10) * (tnNumber%10); CrossProducts.Add(tnNumber, lnCrossProduct); } } else { lnCrossProduct = tnNumber; } return lnCrossProduct; } } }`

Bye, Olaf.

## RE: Monty Hall puzzle

Never give up never give in.

There are no short cuts to anything worth doing