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

Home > Just Math
Distinct Delivery Deduction (Posted on 2014-09-04) Difficulty: 3 of 5
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?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

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

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

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

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

Sub addOn(wh)
  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
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