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

 Prisoner's Visitors Problem (Posted on 2009-01-21)
There are 60 records given to you which correspond to a prisoner who is imprisoned for 60 days. He has 6 relatives one of whom visits him daily and the others visit him every ith day from the day of his imprisonment (i=2,3,4,5,6 for these 5 relatives).
Every record is sealed with the day number on it which indicates the number of days he is jailed when the record is filed with the names of visitors on that particular day. You have to make a new record which should be filled with the following details:

visitor name - number of visits after 60 days

Assume that no other relatives visited him at all, names of these 6 relatives are different and you don't know their names. Find the minimum number of records that need to be checked to make the new record correctly. Find the number of ways you can choose the minimum number of records and you can still make the new record correctly.

 See The Solution Submitted by Praneeth Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 (all solutions) (sign of the beast) | Comment 3 of 7 |
(In reply to better idea (spoiler, part I) by Steve Herman)

cudos on finding the least number of files

I cheated and wrote a quick qbasic program that found all the possible solution with 3 files being opened.  The way I broke it down was by the fact that since all integers are a multiple of 1 then relative 1 has to be the relative that is in all 3.  Also since 4 and 6 are both multiples of 2 then if either of them were one of the relatives in 2 files then so would relative 2 and we would not be able to solve.  Thus both relatives 4 and 6 must be in only 1 file.  This leaves 2,3,5 to be in either 1 or 2 files exactly.  Now since there are only 3 ways for a relative to be in exactly 1 file and 4,6 are already one of these that only leaves 1 slot left for a relative to be in 1 file only.  Since no relatives so far are determined to be in exactly 2 files that leaves all 3 possible ways for 2 files open.  Thus there are only 4 possible ways for the number of files to be broken down by relatives and they are

(top row is relative number, numbers underneath are the number of files they are in exactly for that type of solution)

1 2 3 4 5 6
-------------
3 1 2 1 2 1
3 2 1 1 2 1
3 2 2 1 1 1
3 2 2 1 2 1

using this I went thru every posible combination of 3 files a,b,c with a<b<c (if we are allowing solutions like 1,2,3 and 3,2,1 to be unique then multiply my end number by 6 :-) ) and checked if it fit one of the 4 possible solutions and if it did then printed it and counted it.  After all that I got 666 solutions, the sign of the beast.  This problem is now officially cursed LOL

here are a list of all possible choices for the 3 file numbers

2             3             60
2             5             60
2             9             60
2             12            15
2             12            45
2             15            24
2             15            36
2             15            48
2             21            60
2             24            45
2             25            60
2             27            60
2             33            60
2             35            60
2             36            45
2             39            60
2             45            48
2             51            60
2             55            60
2             57            60
3             4             30
3             5             60
3             6             20
3             6             40
3             8             30
3             10            12
3             10            24
3             10            36
3             10            48
3             12            50
3             14            60
3             16            30
3             18            20
3             18            40
3             20            42
3             20            54
3             22            60
3             24            50
3             25            60
3             26            60
3             28            30
3             30            32
3             30            44
3             30            52
3             30            56
3             34            60
3             35            60
3             36            50
3             38            60
3             40            42
3             40            54
3             46            60
3             48            50
3             55            60
3             58            60
4             5             30
4             6             15
4             6             45
4             9             30
4             15            18
4             15            42
4             15            54
4             18            45
4             21            30
4             25            30
4             27            30
4             30            33
4             30            35
4             30            39
4             30            51
4             30            55
4             30            57
4             42            45
4             45            54
5             6             20
5             6             40
5             8             30
5             9             60
5             10            12
5             10            24
5             10            36
5             10            48
5             12            15
5             12            45
5             12            50
5             14            60
5             15            24
5             15            36
5             15            48
5             16            30
5             18            20
5             18            40
5             20            42
5             20            54
5             21            60
5             22            60
5             24            45
5             24            50
5             26            60
5             27            60
5             28            30
5             30            32
5             30            44
5             30            52
5             30            56
5             33            60
5             34            60
5             36            45
5             36            50
5             38            60
5             39            60
5             40            42
5             40            54
5             45            48
5             46            60
5             48            50
5             51            60
5             57            60
5             58            60
6             8             15
6             8             45
6             9             20
6             9             40
6             15            16
6             15            28
6             15            32
6             15            44
6             15            52
6             15            56
6             16            45
6             20            21
6             20            25
6             20            27
6             20            33
6             20            35
6             20            39
6             20            51
6             20            55
6             20            57
6             21            40
6             25            40
6             27            40
6             28            45
6             32            45
6             33            40
6             35            40
6             39            40
6             40            51
6             40            55
6             40            57
6             44            45
6             45            52
6             45            56
7             10            60
7             15            60
7             20            30
7             30            40
7             45            60
7             50            60
8             9             30
8             15            18
8             15            42
8             15            54
8             18            45
8             21            30
8             25            30
8             27            30
8             30            33
8             30            35
8             30            39
8             30            51
8             30            55
8             30            57
8             42            45
8             45            54
9             10            12
9             10            24
9             10            36
9             10            48
9             12            50
9             14            60
9             16            30
9             18            20
9             18            40
9             20            42
9             20            54
9             22            60
9             24            50
9             25            60
9             26            60
9             28            30
9             30            32
9             30            44
9             30            52
9             30            56
9             34            60
9             35            60
9             36            50
9             38            60
9             40            42
9             40            54
9             46            60
9             48            50
9             55            60
9             58            60
10            11            60
10            12            21
10            12            25
10            12            27
10            12            33
10            12            35
10            12            39
10            12            51
10            12            55
10            12            57
10            13            60
10            17            60
10            19            60
10            21            24
10            21            36
10            21            48
10            23            60
10            24            25
10            24            27
10            24            33
10            24            35
10            24            39
10            24            51
10            24            55
10            24            57
10            25            36
10            25            48
10            27            36
10            27            48
10            29            60
10            31            60
10            33            36
10            33            48
10            35            36
10            35            48
10            36            39
10            36            51
10            36            55
10            36            57
10            37            60
10            39            48
10            41            60
10            43            60
10            47            60
10            48            51
10            48            55
10            48            57
10            49            60
10            53            60
10            59            60
11            15            60
11            20            30
11            30            40
11            45            60
11            50            60
12            14            15
12            14            45
12            15            22
12            15            25
12            15            26
12            15            34
12            15            35
12            15            38
12            15            46
12            15            55
12            15            58
12            21            50
12            22            45
12            25            45
12            25            50
12            26            45
12            27            50
12            33            50
12            34            45
12            35            45
12            35            50
12            38            45
12            39            50
12            45            46
12            45            55
12            45            58
12            50            51
12            50            55
12            50            57
13            15            60
13            20            30
13            30            40
13            45            60
13            50            60
14            15            24
14            15            36
14            15            48
14            21            60
14            24            45
14            25            60
14            27            60
14            33            60
14            35            60
14            36            45
14            39            60
14            45            48
14            51            60
14            55            60
14            57            60
15            16            18
15            16            42
15            16            54
15            17            60
15            18            28
15            18            32
15            18            44
15            18            52
15            18            56
15            19            60
15            22            24
15            22            36
15            22            48
15            23            60
15            24            25
15            24            26
15            24            34
15            24            35
15            24            38
15            24            46
15            24            55
15            24            58
15            25            36
15            25            48
15            26            36
15            26            48
15            28            42
15            28            54
15            29            60
15            31            60
15            32            42
15            32            54
15            34            36
15            34            48
15            35            36
15            35            48
15            36            38
15            36            46
15            36            55
15            36            58
15            37            60
15            38            48
15            41            60
15            42            44
15            42            52
15            42            56
15            43            60
15            44            54
15            46            48
15            47            60
15            48            55
15            48            58
15            49            60
15            52            54
15            53            60
15            54            56
15            59            60
16            18            45
16            21            30
16            25            30
16            27            30
16            30            33
16            30            35
16            30            39
16            30            51
16            30            55
16            30            57
16            42            45
16            45            54
17            20            30
17            30            40
17            45            60
17            50            60
18            20            21
18            20            25
18            20            27
18            20            33
18            20            35
18            20            39
18            20            51
18            20            55
18            20            57
18            21            40
18            25            40
18            27            40
18            28            45
18            32            45
18            33            40
18            35            40
18            39            40
18            40            51
18            40            55
18            40            57
18            44            45
18            45            52
18            45            56
19            20            30
19            30            40
19            45            60
19            50            60
20            21            42
20            21            54
20            23            30
20            25            42
20            25            54
20            27            42
20
 Posted by Daniel on 2009-01-21 22:19:13

 Search: Search body:
Forums (1)