There are eight brothers and sisters in a family: Georgette, Ulysses,
Yvan, Marie, Annette, Roger, Isidore and Emile. All are less then
10 years old. If you represent the age of each child by the first
letter of its name, you obtain:
Y U
------------
G U Y | M A R I E
M A R E
---------
E E
Also, R I * Y = B M R
If Marie is the youngest of the sisters, what is her age?
clearvars,clc
lets='yugmarieb';
nums='1234567890';
idx=combinator(10,9,'p');
numsets=nums(idx);
for i=1:length(numsets);
nvals=numsets(i,:);
yu=str2double(trans('yu',lets,nvals));
guy=str2double(trans('guy',lets,nvals));
marie=str2double(trans('marie',lets,nvals));
ee=str2double(trans('ee',lets,nvals));
if yu*guy==marie-ee
ri=str2double(trans('ri',lets,nvals));
bmr=str2double(trans('bmr',lets,nvals));
y=str2double(trans('y',lets,nvals));
if ri*y==bmr
disp([yu guy marie])
end
end
end
where the trans function is
function t=trans(s,from,to)
let0=cellstr(from');
let1=cellstr(to');
t=replace(s,let0,let1);
end
finds the integers YU, GUY and MARIE to be
90 409 36821
then
82 * 9 = 738
So the ages are given by:
GUYMARIE
40936821
Marie is 3, and indeed younger than her sisters Georgette and Annette, who are 4 and 6, though that was not needed for the decypherment.
Ulysses would customarily have his age counted in months.
90
------
409 )36821
3681
-----
11
|
Posted by Charlie
on 2024-10-31 17:21:04 |