Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4577656
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:22:35+00:00 2026-05-21T20:22:35+00:00

Here is my scenario: This problem is couched in terms of liars and truth

  • 0

Here is my scenario:

This problem is couched in terms of liars and truth tellers, but it has real applications in identifying which componants of a complex system are good (functioning correctly) and which are faulty. Assume we have a community of n people and we know an integer number t < n/2, which has the property that most t of the n people are liars. This does not say that there actually are t liars, but only that there are at most t liars.

I assume that the truth-tellers are always truthful and correct and a liar may tells the wrong answer or right answer.

We will identify the liars in the community by successively picking pairs of people, (X, Y ) say, and asking X: Is Y a liar?. The response is either “yes” or “no”;

What is the optimum algorithm(minimum number of steps) to find all the liars?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T20:22:36+00:00Added an answer on May 21, 2026 at 8:22 pm

    Random algorithm with optimal expected running time of O(n) and excellent constants:

    1. Select at person at random
    2. Ask the rest of the people whether he’s a liar, until one option (either “yes” or “no”) has weight > n/2 (i.e. until more than n/2 people gave the same answer).
      Majority decides (this is the key observation!).
    3. If he is not a liar, then iterate over the remaining people and ask only him whether or not each person is a liar (since we determined that he tells the truth).
    4. If he is a liar, take him out of the group and go back to 1.

    The key observation is that if we ask everyone about a single individual the majority opinion will have to be correct (since there is a majority of truth tellers). A slight technicality is if we pick a non-liar first and ask everyone else, assuming all liars lie, we will reach a 50-50, so how do we decide which side is telling the truth? That isn’t a problem, since we can only reach a 50-50 if we picked a non-liar in the first place, so our person in question is indeed a truth-teller.

    The expected number of people we will have to choose randomly is O(1) (this is the meatiest part of this question, and since it may be homework, I’ll skip the proof, but hint for an easy proof: geometric distribution), which means we will find our truth-teller and reliable source in O(1)*O(n) time, and from there it’s another O(n) till the finish. In total, O(n).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are many errors here in SO, but this scenario I think its different.
Here is my scenario. User fills out this large page which is dynamically created
I have a problem with database query? Here is the Scenario This is a
Here's the scenario: if this is a user's first time logging into my web
Here the scenario : A method is called each minute by a timer. This
Sorry, not clear how to ask this question. Here's my scenario: Controller HostSite hostSite=new
Ok, I'm not quite sure how to go about this. Here's the scenario. 1)
this is my scenario. My application urls are showed like this: example.com/index.php/article/whatever/here in order
I know how to write tab host,but here the scenario is little bit different
Here's the scenario: I have a multi threaded java web application which is running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.