INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Monty Hall puzzle 4

 Forum Search FAQs Links MVPs

## 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

It wasn't here, I can assure you.

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

> most (in my experience) people cannot/will not accept

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

@ strongm

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

Intriguing. I need to have a think to see if that represents the same problem, though.

### RE: Monty Hall puzzle

(OP)
Thank all no Chris its not the tread I was talking about. Yes to all I know the answer about the three doors. But the original post also had a puzzle where the answer was based on bases the next number in the series was 1111 but the one before was 50 cujancenturan pointed out it should have been 120. I hope this explains a bit better.

Never give up never give in.

There are no short cuts to anything worth doing

### RE: Monty Hall puzzle

@assets

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

#### Quote:

What is the next number in this sequence
15, 16, 17, 21, 23, 30, 33, 50, ???

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

@ Strongm re:>> I need to have a think to see if that represents the same problem, though.

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

>It does not matter whether the dud door is revealed or not before the choice

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

#### Quote:

where the answer was based on bases the next number in the series was 1111

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

(OP)
THANKS everyone you ALL have been of a great help so hope the stars show up if not will have to try again to give you one. The Marilyn vos Savant has some good links people will still argue about the result. But that good to get people involved. As William S said To switch or not the Switch that is the question.

Never give up never give in.

There are no short cuts to anything worth doing

### RE: Monty Hall puzzle

(OP)
For those who are reading and have not posted. I explain what we are talking about:

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

This sequence of 15 in different bases is nice. You can also reverse the sequence, then you'd get

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

@Olaf (or anyone else for that matter)

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

I wouldn't have seen the pattern of 15 in different bases myself, too, if assets wouldn't have explained it, so don't worry about that, it's really hard to think out of the box of decimal numbers, if it's not obvious enough from the context.

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

(OP)
Roman numerals on a clock 4 is IIII and not IV ( for 15 you have 15 I big number), so as if you were counting animal and cutting a notch in a piece timber. you would have IIIIIIIIIIIIIII notches if you had 15 animals. So I agree with answer

Never give up never give in.

There are no short cuts to anything worth doing

### RE: Monty Hall puzzle

@Olaf - you nailed 2 of my reasons for not accepting 111111111111111 as a base 1 representation of 15

The strongest argument in my mind this one:

#### Quote:

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.

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

(OP)
Yes it not base 1 that why I used I and not 1. Odd or Evens numbers. Number go odd, even, odd, even. So you may say 0 (zero) is even it fall between two odds. BUT it doe not meet the test an even number can be divided by 2 so ) is not even. So in my example if there is no cuts on the timber then it 0 ( we do not know if 0 or just a bit if timber). But 0 can not be in base 1 as it does not exist. Just a counting system like for 5 you have IIII with the fifth I at an angle to make counting easier.

Never give up never give in.

There are no short cuts to anything worth doing

### RE: Monty Hall puzzle

(OP)
A number's persistence is the number of steps required to reduce it to a single digit by multiplying all its digits to obtain a second number, then multiplying all the digits of that number to obtain a third number, and so on until a one-digit number is obtained. For example, 77 has a persistence of four because it requires four steps to reduce it to one digit: 77-49-36-18-8. The smallest number of persistence one is 10, the smallest of persistence two is 25, the smallest of persistence three is 39, and the smaller of persistence four is 77. What is the smallest number of persistence five?

Never give up never give in.

There are no short cuts to anything worth doing

### RE: Monty Hall puzzle

It would be time to start a new thread for a new puzzle, but anyway.

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:

679 (679-378-16-48-32-6)

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

@ Olaf, why did you assume it would be a number higher than 77?

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

Very quick & dirty python code confirms olafs answer

#### CODE

def persistance (number,count):
result=int(str(number)[0])
count=count+1
for digit in str(number)[1:]:
result= result * int(digit)
if len(str(result))>1:
result,count=persistance(result,count)
return result,count

def main():
for number in range(10,1000):
result,count=persistance(number,count=0)
if count==7 :
print number,result,count
break

if __name__ == '__main__':
main()

A Maintenance contract is essential, not a Luxury.
Do things on the cheap & it will cost you dear

### RE: Monty Hall puzzle

Confirming Olaf has the correct answer.

The next level answer is

#### Hidden:

6788, (2688, 768, 336, 54, 20, 0)

After that is

#### Hidden:

68889 (27648, 2688, 768, 336, 54, 20, 0)

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

### RE: Monty Hall puzzle

First, what actually is wrong with my answer is the sequence, at one place am 8 is missing.

>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

Again...

>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 Persistence 4. There can't be such an m and so the smallest number with Persistence 5 must 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

@Olaf

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

I also know the Euler project, but haven't done something for quite a while.

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

You guys are nothing if not ambitious. There is no number known of persistence > 11, and it is conjectured that 11 is the maximum possible persistence for base 10. According to Wolfram Mathworld, this has been tested up to 10233.

### RE: Monty Hall puzzle

thanks for that I will stop trying to streamline my code now

A Maintenance contract is essential, not a Luxury.
Do things on the cheap & it will cost you dear

### RE: Monty Hall puzzle

@Karluk

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

The lower bound for searching for a number with persistence 12 is apparently much larger than 10233. The on-line encyclopedia of integer sequences says in its comments to sequence A014553 that

#### Quote (OEIS)

a number with multiplicative persistence 12 must have more than 2530 digits.

http://oeis.org/A014553

### RE: Monty Hall puzzle

Here is a link to one of the papers that investigated limits on the size of a number with persistence 12. I gather that the reason for the general belief that there is no number with a persistence of 12 is that, as the number of digits in a number increases, it quickly becomes overwhelmingly likely that multiplying the digits of the number will produce a product with a zero digit. Then the next iteration will result in a product of zero, so large numbers tend to have a persistence of two. But nobody has proven that persistence 11 is the limit, so there has been a flurry of activity in recent years pushing the bounds higher and higher in the search for persistence 12.

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

### RE: Monty Hall puzzle

Here's a version using C# and dictionaries to not make any double calculations.

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;

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;
}
}

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);
}
}
else
{
lnCrossProduct = tnNumber;
}

return lnCrossProduct;
}
}
}

Bye, Olaf.

### RE: Monty Hall puzzle

(OP)
well done everyone it has sure started so debate

Never give up never give in.

There are no short cuts to anything worth doing

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

#### Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!