All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Foreheads (Posted on 2024-01-22) Difficulty: 3 of 5
A math wizard has a bag containing the digits 0 through 9, and has used six of them to stick two different three-digit perfect squares on the foreheads of Ann and Ben. Both Ann and Ben know this fact, but each person can see only the other person's number. The wizard asks Ann, "How many of the digits remaining in my bag can you exactly tell me?"
Ann replies, "Two."
Ben then says: "I know my number."

There are 3 possible 3-digit numbers on Ben's forehead. What are they?

  Submitted by K Sengupta    
Rating: 5.0000 (1 votes)
Solution: (Hide)
clearvars,clc
squares=[];
for sr=10:31
  sq=sr^2;
  squares(end+1)=sq;
end
for i=1:length(squares)
  whole='0123456789';
  for j=1:length(squares)
    tst=num2str(squares(i)*1000+squares(j));
    if isequal(unique(tst,'stable'),tst)
      disp([squares(i) squares(j)])
      whole=setdiff(whole,tst);
    end    
  end
  if length(whole)<5
    disp(whole)
    disp(' ')
  end
end

produces the below table of possible pairs of squares:

The first entry shows what the situation is when Ann sees Ben has 169.

She sees that regardless of whether she has 324 or 784, she knows that zero and 5 both remain in the bag as shown on the bottom line of that group.


   Ben   Ann
   
   169   324
   169   784
05
 
   196   324
   196   784
05
 
   256   784
   256   841
039
 
   289   361
   289   576
04
 
   324   169
   324   196
   324   576
   324   961
08
 
   361   289
   361   529
   361   729
   361   784
0
 
   529   361
   529   784
   529   841
0
 
   576   289
   576   324
   576   841
0
 
   625   784
   625   841
039
 
   729   361
   729   841
05
 
   784   169
   784   196
   784   256
   784   361
   784   529
   784   625
   784   961
0
 
   841   256
   841   529
   841   576
   841   625
   841   729
03
 
   961   324
   961   784
05

Below are separated out, those cases where Ann could tell exactly two of the digits that remain in the wizards bag.


   169   324 *
   169   784 *
05
 
   196   324
   196   784
05
   289   361 *
   289   576 *
04
   324   169  *
   324   196  *
   324   576   
   324   961  
08
   729   361
   729   841  
05
   841   256  
   841   529  
   841   576
   841   625  
   841   729  
03
   961   324
   961   784
05

I've put an * against those cases where Ann's number (which Ben sees) uniquely identifies Ben's number to Ben. These have the values 169, 289, and 324 on Ben's forehead.
>> 

Comments: ( You must be logged in to post comments.)
  Subject Author Date
No SubjectK Sengupta2024-01-25 20:10:50
anonymoHedda Dunn2024-01-25 13:31:12
Solutioncomputer-aided solutionCharlie2024-01-22 09:10:25
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information