Paul the postal carrier had an unusual week involving the ten properties along Park Place. Each day of the week Monday through Saturday he delivered mail to four houses. Eight of the houses received mail on three days and two houses got no mail.
The houses along Park Place are numbered 1 to 10. The sum of the house numbers Paul delivered for each day of the week were:
- Monday: 12
- Tuesday: 18
- Wednesday: 23
- Thursday: 32
- Friday: 25
- Saturday: 19
Which two houses did not receive mail?
I used Mathematica for this one and found that the 2 houses
that did not receive mail were 4 and 8. I found 13 ways of accomplishing this and those are
Solution 1:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {10,5,2,1}
Wednesday: {10,7,5,1}
Thursday: {10,9,7,6}
Friday: {9,7,6,3}
Saturday: {9,5,3,2}
++++++++++++++++++++++++++++++
Solution 2:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {10,5,2,1}
Wednesday: {9,7,6,1}
Thursday: {10,9,7,6}
Friday: {10,7,5,3}
Saturday: {9,5,3,2}
++++++++++++++++++++++++++++++
Solution 3:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {10,5,2,1}
Wednesday: {9,7,5,2}
Thursday: {10,9,7,6}
Friday: {10,7,5,3}
Saturday: {9,6,3,1}
++++++++++++++++++++++++++++++
Solution 4:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {10,5,2,1}
Wednesday: {9,7,5,2}
Thursday: {10,9,7,6}
Friday: {9,7,6,3}
Saturday: {10,5,3,1}
++++++++++++++++++++++++++++++
Solution 5:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {10,5,2,1}
Wednesday: {9,6,5,3}
Thursday: {10,9,7,6}
Friday: {10,7,5,3}
Saturday: {9,7,2,1}
++++++++++++++++++++++++++++++
Solution 6:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {9,6,2,1}
Wednesday: {10,7,5,1}
Thursday: {10,9,7,6}
Friday: {10,7,5,3}
Saturday: {9,5,3,2}
++++++++++++++++++++++++++++++
Solution 7:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {9,6,2,1}
Wednesday: {9,7,5,2}
Thursday: {10,9,7,6}
Friday: {10,7,5,3}
Saturday: {10,5,3,1}
++++++++++++++++++++++++++++++
Solution 8:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {9,5,3,1}
Wednesday: {10,7,5,1}
Thursday: {10,9,7,6}
Friday: {10,7,6,2}
Saturday: {9,5,3,2}
++++++++++++++++++++++++++++++
Solution 9:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {9,5,3,1}
Wednesday: {10,6,5,2}
Thursday: {10,9,7,6}
Friday: {10,7,5,3}
Saturday: {9,7,2,1}
++++++++++++++++++++++++++++++
Solution 10:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {9,5,3,1}
Wednesday: {9,7,5,2}
Thursday: {10,9,7,6}
Friday: {10,7,6,2}
Saturday: {10,5,3,1}
++++++++++++++++++++++++++++++
Solution 11:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {9,5,3,1}
Wednesday: {9,7,5,2}
Thursday: {10,9,7,6}
Friday: {10,7,5,3}
Saturday: {10,6,2,1}
++++++++++++++++++++++++++++++
Solution 12:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {7,6,3,2}
Wednesday: {10,7,5,1}
Thursday: {10,9,7,6}
Friday: {10,9,5,1}
Saturday: {9,5,3,2}
++++++++++++++++++++++++++++++
Solution 13:
Houses with no mail: {4,8}
Deliveries:
Monday: {6,3,2,1}
Tuesday: {7,6,3,2}
Wednesday: {9,7,5,2}
Thursday: {10,9,7,6}
Friday: {10,9,5,1}
Saturday: {10,5,3,1}
++++++++++++++++++++++++++++++
And the mathematica code I used to generate these is:
Needs["Combinatorica`"];
tots={12,18,23,32,25,19};
parts={};
For[d=1,d<=6,++d,
n=tots[[d]];
pt=Partitions[n,10];
pts={};
lng=Length[pt];
For[i=1,i<=lng,++i,
p=pt[[i]];
If[Union[p]==Sort[p] && Length[p]==4,pts=Append[pts,p]];
];
parts=Append[parts,pts];
];
lngs=Table[Length[parts[[i]]],{i,1,6}];
week={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
sols=0;
For[i1=1,i1<=lngs[[1]],++i1,
For[i2=1,i2<=lngs[[2]],++i2,
For[i3=1,i3<=lngs[[3]],++i3,
For[i4=1,i4<=lngs[[4]],++i4,
For[i5=1,i5<=lngs[[5]],++i5,
For[i6=1,i6<=lngs[[6]],++i6,
idxs={i1,i2,i3,i4,i5,i6};
Houses=Table[0,{i,1,10}];
Cnts=Table[0,{j,1,7}];
For[i=1,i<=6,++i,
pt=parts[[i,idxs[[i]]]];
lng=Length[pt];
For[j=1,j<=lng,++j,
Houses[[pt[[j]]]]++;
];
];
For[i=1,i<=10,++i,
Cnts[[Houses[[i]]+1]]++;
];
If[Cnts[[1]]==2 && Cnts[[4]]==8,
sols++;
nomail={};
For[j=1,j<=10,++j,
If[Houses[[j]]==0,nomail=Append[nomail,j]];
];
Print["Solution ",sols,":"];
Print["Houses with no mail: ",nomail];
Print["Deliveries: "];
For[j=1,j<=6,++j,
Print[week[[j]],": ",parts[[j,idxs[[j]]]]];
];
Print["++++++++++++++++++++++++++++++"];
];];];];];];];
|
Posted by Daniel
on 2009-11-17 13:18:53 |