Did I do this CS logic problem right?

  • Thread starter rnj76543
  • Start date
  • Tags
    Cs Logic
In summary, the conversation discusses a logic problem involving truth-tellers and liars on an island. The problem involves three individuals, A, B, and C, and the question of which category B and C belong in and if anything can be determined about A's category. The solution involves creating propositions and using logic to determine that B is lying and C is telling the truth, but it is impossible to determine A's category. The conversation ends with the individual feeling more confident in their solution.
  • #1
rnj76543
3
0
Hi everybody, I just want to check to make sure I did this problem right. I know the answer I just need to make sure I did it formally.

Homework Statement


The problem goes like this: a logician is on an island with two groups of people truth-tellers and liars. He meets three individuals, A, B and C. A says something he can't understand, B says "A said he is a liar" and C says "B is telling a lie." Truth-tellers only tell the truth and liars only lie. I was asked to answer this question: Which category do B and C belong? Can you tell anything about the category A fits in?My solution, is this correct?
Here ] = negation/not, -> is implication(if/then), and ^ is logical and.
Propositions I came up with:
A: I am a liar
B: A said he is a liar
C: B is the liar

I thought it out beforehand and C is telling the truth. If A said he is a liar and this is true then he is a truth-teller which means he isn't a liar(a contradiction) and hence B is wrong and therefore C is correct.

I formalized it has such:

( (A -> ]A) ^ (B -> (A ^ ]C)) ^ (C -> (]A ^ ]B))

I did a truth table and besides one impossible answer I got C to work out right and nothing else to be true. But is this the right formula afterall?

I do not want any answers I just want to know if I'm doing it right. And maybe if your feeling kind you can tell me where to look next if I'm doing it wrong.

Again, I know the answer I just need help formalizing it or rather checking my answer.

Thanks for all of your time!
 
Last edited:
Physics news on Phys.org
  • #2
you posted a setup about truth tellers and liars but you never mentioned what you're trying to find or solve for
 
  • #3
Darn! That's what late nights and early mornings do to a person ha. I was asked to answer this question: Which category do B and C belong? Can you tell anything about the category A fits in?
 
  • #4
for this scenario, no one can say, "I am a liar." if someone is a liar and says it, he told the truth, and if someone is a truth teller and says it, he told a lie. Therefore, B is lying. As such, C must be telling the truth. There is no way to say if A is a truthteller or a liar.
 
  • #5
Cool. I think I know how to fix it now. Thanks a bunch.
 

1. How do I know if my solution to a CS logic problem is correct?

If you followed the given instructions correctly and your solution meets all the requirements, then your solution is most likely correct. However, it is always a good idea to double check your work and ask for feedback from others.

2. What should I do if I am stuck on a CS logic problem?

If you are stuck on a CS logic problem, take a step back and review the problem and your approach to solving it. Sometimes, taking a break and coming back to the problem with a fresh perspective can also be helpful. If you are still stuck, don't hesitate to reach out for help from a classmate or instructor.

3. Is there a specific way to solve CS logic problems?

There is no one specific way to solve CS logic problems. Each problem may require a different approach or algorithm. It is important to understand the problem and use your knowledge of CS concepts to come up with a solution.

4. Should I try to optimize my solution to a CS logic problem?

Optimizing your solution to a CS logic problem is not always necessary, but it can be a good exercise to improve your problem-solving skills. If you have the time and resources, it is worth trying to optimize your solution. However, it is more important to have a correct solution than an optimized one.

5. What if my solution to a CS logic problem is different from the given solution?

There is often more than one way to solve a CS logic problem. If your solution is different from the given solution but still meets all the requirements, then it is a valid solution. However, if you are unsure about your solution, it is always a good idea to ask for feedback from others.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
20
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Programming and Computer Science
Replies
15
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
Back
Top