# Beginner Logic Puzzle - Web Site Log

I recently began creating my own logic puzzles. I thought I'd share some, from easy to hard here. Here is an easy one to get you warmed up!

Puzzle Information

A group of friends - John, Heather, and Mike decided to log how many hours per week they visited their favorite web site. Based on the clues below, find out who visited what site, and for how long.

Clues

• John favorite site is TechCrunch
• StackOverflow was visited 7 Hours
• Mike visited 5 Hours

Web Sites:

1. StackOverflow
2. TechCrunch
3. W3Schools

People:

1. John
2. Heather
3. Mike

Hours:

1. Five hours (5)
2. Seven hours (7)
3. Ten hours (10)

Mike visited W3Schools Five Hours

John visited TechCrunch Ten Hours

Heather visited StackOverflow Seven Hours

Because

Mike visited 5 hours, which is not StackOverflow (as for StackOverflow, it's 7 hours). TechCrunch is not Mike's favorite as it's the favorite site of John.

Which yields

Mike visited W3Schools 5 hours

Now

John's favorite site is TechCrunch and time visited on StackOverflow was 7 and for W3Schools was 5.

and it yields

John visited TechCrunch 10 Hours

Now what left is

Heather visited StackOverflow Seven Hours

John - TechCrunch - 10 hours
Mike - W3Schools - 5 hours
Heather -StackOverflow - 7 hours

Reasoning:

• John's site is TechCrunch (it was given) and Mike visited 5 hours and Stack Overflow was visited for 7 hours so the remaining from your clue list is 10 hours thus (John-Tech-10)

• Stack Overflow was visited 7 hours so it was not Mike (because Mike visited 5 hours) so it was Heather.

• And the remaining combination itself serves as the answer.

Let's create a table and start filling it with what we know:

          +---------+----------------+----------+
| John    | TechCrunch     |     ?    |
+---------+----------------+----------+
| Heather |        ?       |     ?    |
+---------+----------------+----------+
| Mike    |        ?       | 5 Hours  |
+---------+----------------+----------+ 

Now, we know that:

StackOverflow was visited 7 Hours, which means it must be Heather's favorite site!

and

The only site we have left is W3Schools which must be Mikes's favorite

Last thing,

We now know that John visited TechCrunch for 10 hours

Let's draw the final table:

          +---------+----------------+----------+
| John    | TechCrunch     | 10 Hours |
+---------+----------------+----------+
| Heather | Stack Overflow | 7 Hours  |
+---------+----------------+----------+
| Mike    | W3Schools      | 5 Hours  |
+---------+----------------+----------+ 

We have the logics: $$JT(\implies \lnot JS, \lnot JW, \lnot MT, \lnot HT)\tag1$$ $$S7(\implies \lnot S5, \lnot SX, \lnot T7, \lnot W7)\tag2$$ $$M5(\implies \lnot M7, \lnot MX, \lnot J5, \lnot H5)\tag3$$

Initial possibles:

JS5 JS7 JSX
JT5 JT7 JTX
JW5 JW7 JWX
MS5 MS7 MSX
MT5 MT7 MTX
MW5 MW7 MWX
HS5 HS7 HSX
HT5 HT7 HTX
HW5 HW7 HWX


Reduction by (1):

JT5 JT7 JTX
MS5 MS7 MSX
MW5 MW7 MWX
HS5 HS7 HSX
HW5 HW7 HWX


Reduction by (2):

JT5 JTX
MS7
MW5 MWX
HS7
HW5 HWX


Reduction by (3):

JTX
MW5
HS7
HWX


As X is taken by the unique JTX and the W by the unique MW5, we conclude:

JTX, MW5, HS7.

• Hey @JohnMark Perry, your answer is very interesting in the way you approached this. Could you please share any useful links or documentation that would elaborate on the "mathematical" approach you have taken to solve my puzzle? Jan 29 '19 at 13:15
• @JohnS.; I made it up, with a lot of help from puzzler.com/magazines/logic/logic-problems
– JMP
Jan 29 '19 at 13:32

Mike w3 Schools 5 hr. Stack overflow was visited for 7 hr, and John's favorite was Tech Crunch. John TechCrunch, 10 hr Stack overflow was visited for 7 hr Heather Stack Overflow 7 hr