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

 Distinct Delivery Deduction (Posted on 2014-09-04)
Art, the mail carrier delivers mail to the 19 houses on the east side of a street.

Art notices that:
(i) No two adjacent houses ever get mail on the same day, and:
(ii) There are never more than two houses in a row that get no mail on the same day.

How many distinct patterns of mail delivery are possible?

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 a computer solution | Comment 3 of 7 |
After listing all the possibilities

DefDbl A-Z
Dim crlf\$, h(19), ct

ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf\$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents

Text1.Text = Text1.Text & ct & crlf & " done"
End Sub

For i = 0 To 1
good = 1
h(wh) = i
If h(wh) = 1 And h(wh - 1) = 1 Then good = 0
If wh > 2 Then
If h(wh) + h(wh - 1) + h(wh - 2) = 0 Then good = 0
End If
If good Then
If wh = 19 Then
ct = ct + 1
For j = 1 To 19
Text1.Text = Text1.Text & Str(h(j))
DoEvents
Next
Text1.Text = Text1.Text & crlf
DoEvents
Else
addOn wh + 1
End If
End If
Next i
End Sub

lists

351

 Posted by Charlie on 2014-09-04 17:33:37

 Search: Search body:
Forums (0)