Page 1 of 1

Logic puzzles

Posted: November 17th, 2020, 1:16 pm
by MathAndCode
MathAndCode wrote: November 17th, 2020, 1:13 pm
Moosey wrote: November 17th, 2020, 1:08 pmthere are, however, districts, and they are drawn in a way so that each district has a color. The man with the shovel was not in the yellow district, and either the blue district or the green district contained the axe-wielder. The ultimate results of the election may come down to the german who is either in the red district or the yellow district.
I'm going to make a topic for logic puzzles so that you can post the complete problem there.
In addition to Moosey's puzzle, I shall present the following problem: You are given thirteen coins and told that one of those coins is false. The only way to figure out which coin is false is by detecting its different in weight from the genuine coins using a balance scale, but you don't know whether the false coin is heavier or lighter than a genuine coin. How can you find out which coin is false while only using the balance scale three times?

Re: Logic puzzles

Posted: November 17th, 2020, 7:31 pm
by Moosey
ok I think I'll actually make my joke into a puzzle

Each district has either one or zero people in it. the districts are:
red - votes saka
blue - votes dvgrn
green - votes saka
yellow - votes dvgrn
purple - votes saka
orange - votes dvgrn

The following is known:
(1) the red district is occupied
(2) the man with the fish is either in the blue district, the green district, or the yellow district
(3) Saka won the election.
(4) the man with the toad is in a district which votes for dvgrn, and is somewhere below the man with fish in the district list.
(5) districts only vote if occupied.
(6) if he exists, the man with the dog is in either the orange district or the purple district
(7) there is a woman with a cat, in either the red blue or green district
(8) neither the person with the iguana nor the toad is in the orange district. The person with the iguana is immediately below the person with the fish in the district list.
(9) there are no other people or pets.
(10) all pets are unique.
(11) a person may only vote once

What pets occupy which districts?

Code: Select all

SOLUTION (SPOILER)

















































haha did you really think I'd not force you to solve it to find a solution

Re: Logic puzzles

Posted: November 17th, 2020, 8:12 pm
by goldenratio
Solution to Moosey's puzzle:

Code: Select all















We know there are at least four people, so the only way Saka can win the election is if three districts vote for him 
and two districts vote for dvgrn. Thus the man with the dog must exist. Since the man with the toad has to be in a 
dvgrn-voting non-orange district, he must be in either the blue or yellow districts. However, he can't be in the blue 
district since the man with the fish has to be above him (which can only be the red district) but that can't happen 
since the toad man is occupying the space immediately below the man with the fish, which we know has to be taken 
by the person with the iguana. So the man with the toad has to be in the yellow district. This leaves only red and blue 
districts for the man with the fish, and then we know that he has to be in the blue district, and the person with the 
iguana has to be in the green district. Now this only leaves the red district for the woman with the cat, and the man 
with the dog must be in the purple district or else dvgrn would have a majority vote. So the pets in each district are:

red (saka) - cat
blue (dvgrn) - fish
green (saka) - iguana
yellow (dvgrn) - toad
purple (saka) - dog
orange (dvgrn) - unoccupied

Re: Logic puzzles

Posted: November 17th, 2020, 8:30 pm
by MathAndCode
Moosey wrote: November 17th, 2020, 7:31 pm ok I think I'll actually make my joke into a puzzle

Each district has either one or zero people in it. the districts are:
red - votes saka
blue - votes dvgrn
green - votes saka
yellow - votes dvgrn
purple - votes saka
orange - votes dvgrn

The following is known:
(1) the red district is occupied
(2) the man with the fish is either in the blue district, the green district, or the yellow district
(3) Saka won the election.
(4) the man with the toad is in a district which votes for dvgrn, and is somewhere below the man with fish in the district list.
(5) districts only vote if occupied.
(6) if he exists, the man with the dog is in either the orange district or the purple district
(7) there is a woman with a cat, in either the red blue or green district
(8) neither the person with the iguana nor the toad is in the orange district. The person with the iguana is immediately below the person with the fish in the district list.
(9) there are no other people or pets.
(10) all pets are unique.
(11) a person may only vote once

What pets occupy which districts?
(Was using a toad in #4 intentional?)

Code: Select all

Scroll down if you want to read the solution and how I obtained it.




















The man with the toad voted for dvgrn (ironically) by (4) and therefore must live in the blue, yellow, or orange district. He cannot be in the orange district because of (8). The man with the fish must live in the blue, green, or yellow district by (2), and the man with the toad must live in a district below the district that the man with the fish lives in by (4), so the man with the toad cannot live in the blue district. Therefore, the man with the toad must live in the yellow district.
The man with the fish must live in the blue, green, or yellow district by (2). Because the yellow district is taken by the man with the toad, the man with the fish must live in the blue district or the green district. If the man with the fish lived in the green district, the person with the iguana must live in the yellow district by (8), but the yellow district is already taken by the man with the toad, so the man with the fish must live in the blue district, so the man with the iguana must live in the green district by (8).
(7) states that the woman with the cat must live in either the red district or the green district. She cannot live in the green district because that is taken by the man with the iguana, so she must live in the red district.
If the man with the dog does not exist, then the election would have been tied because the woman with the cat and the person with the iguana voted for Saka, and the man with the fish and the man with the toad voted for dvgrn. However, Saka won the election by (3), so the man with the dog must exist and must have voted for Saka. Because the only remaining district that would have voted for Saka is the purple district, the man with the dog must live in the purple district.

Summary:
The red district houses a cat.
The blue district houses a fish.
The green district houses an iguana.
The yellow district houses a toad.
The purple district houses a dog.
The orange district is empty.

Re: Logic puzzles

Posted: November 18th, 2020, 2:35 am
by toroidalet

Code: Select all















The only person who could be in the red district is the woman with the cat. We will never use this fact again but it means we can ignore her.
The person in the red district votes for Saka, and the person with the toad votes for dvgrn, so they are tied. Since adjacent districts vote for different candidates, the fish and iguana's votes cancel each other out. Both candidates are tied now but Saka won, so the final person (the dog owner) must have voted for him and is therefore in the purple district.
Since the toad is below the fish, he must be somewhere below the blue district (the top unoccupied one) but cannot be in the orange district. The only dvrgn-voting district left is the yellow one.
Since the iguana is directly below the fish, they can only be in the green and blue districts, respectively (no currently unoccupied districts are adjacent to the orange one).
The cat is in the red district, the fish in the blue, iguana in green, toad in yellow, and dog in purple. The orange district had a population of 0 in the 2020 census and thus gets 0 representatives (but 2 senators to be chosen somehow?)