SlideShare a Scribd company logo
A group of n people were removed from the hotel. After a month, the kidnappers need to get rid of
these people, but they just don't want to let them go. They inform the hostages one evening that
the next morning they will be lined up one behind the other so that everyone sees those in front of
them but none behind. Then the captors will pass, starting with the last in line, and put a hat on
everyone's head, either red or black. Hats put down, the kidnappers will come back, always
starting at the end of the line, asking the simple question: what color hat do you have?. If the
person gives the correct color, they will be released. Otherwise, it will be executed instantly. The
only answer allowed (one that will not cause the responder to execute) is the color, black or red.
(a) How many people can be saved and how? Explain in detail (a formal proof but not necessary
at this time).
(b) Give (draw) an AFD that models the rescue protocol, with its interpretation. Pay attention to the
alphabet and the states.
2. Give a context-free grammar that generates the language L = {w {(,)} : w is parenthesis}. Prove
your answer.

More Related Content

More from ADITIHERBAL

A Health Behaviour in Schoolaged Children study found that .pdf
A Health Behaviour in Schoolaged Children study found that .pdfA Health Behaviour in Schoolaged Children study found that .pdf
A Health Behaviour in Schoolaged Children study found that .pdf
ADITIHERBAL
 
a Identify all NE throughout 3 you are only required to p.pdf
a Identify all NE throughout 3 you are only required to p.pdfa Identify all NE throughout 3 you are only required to p.pdf
a Identify all NE throughout 3 you are only required to p.pdf
ADITIHERBAL
 
A hoverboard is a levitating board similar in shape and size.pdf
A hoverboard is a levitating board similar in shape and size.pdfA hoverboard is a levitating board similar in shape and size.pdf
A hoverboard is a levitating board similar in shape and size.pdf
ADITIHERBAL
 
A hospital is trying to cut down on emergency room wait time.pdf
A hospital is trying to cut down on emergency room wait time.pdfA hospital is trying to cut down on emergency room wait time.pdf
A hospital is trying to cut down on emergency room wait time.pdf
ADITIHERBAL
 
A healthy female Labrador retriever was mated with two healt.pdf
A healthy female Labrador retriever was mated with two healt.pdfA healthy female Labrador retriever was mated with two healt.pdf
A healthy female Labrador retriever was mated with two healt.pdf
ADITIHERBAL
 
A hypertonic solution is prepared by the addition of sucrose.pdf
A hypertonic solution is prepared by the addition of sucrose.pdfA hypertonic solution is prepared by the addition of sucrose.pdf
A hypertonic solution is prepared by the addition of sucrose.pdf
ADITIHERBAL
 
A group of employees of Unique Services will be surveyed abo.pdf
A group of employees of Unique Services will be surveyed abo.pdfA group of employees of Unique Services will be surveyed abo.pdf
A group of employees of Unique Services will be surveyed abo.pdf
ADITIHERBAL
 
A Genler aras sekanslar insan genomunun gt60n oluturur.pdf
A Genler aras sekanslar insan genomunun gt60n oluturur.pdfA Genler aras sekanslar insan genomunun gt60n oluturur.pdf
A Genler aras sekanslar insan genomunun gt60n oluturur.pdf
ADITIHERBAL
 
a Given that XX1X2Xn represents a random sample of .pdf
a Given that XX1X2Xn represents a random sample of .pdfa Given that XX1X2Xn represents a random sample of .pdf
a Given that XX1X2Xn represents a random sample of .pdf
ADITIHERBAL
 
A genetic disorder shows cytoplasmic inheritance A heteropl.pdf
A genetic disorder shows cytoplasmic inheritance A heteropl.pdfA genetic disorder shows cytoplasmic inheritance A heteropl.pdf
A genetic disorder shows cytoplasmic inheritance A heteropl.pdf
ADITIHERBAL
 
A generic queue is a general queue storage that can store an.pdf
A generic queue is a general queue storage that can store an.pdfA generic queue is a general queue storage that can store an.pdf
A generic queue is a general queue storage that can store an.pdf
ADITIHERBAL
 
A formal often temporary partnership involving two or more.pdf
A formal often temporary partnership involving two or more.pdfA formal often temporary partnership involving two or more.pdf
A formal often temporary partnership involving two or more.pdf
ADITIHERBAL
 
A Galup Roll released in December 2010 asked 2500 adults INi.pdf
A Galup Roll released in December 2010 asked 2500 adults INi.pdfA Galup Roll released in December 2010 asked 2500 adults INi.pdf
A Galup Roll released in December 2010 asked 2500 adults INi.pdf
ADITIHERBAL
 
A functional genomics experiment is carried out in E coli t.pdf
A functional genomics experiment is carried out in E coli t.pdfA functional genomics experiment is carried out in E coli t.pdf
A functional genomics experiment is carried out in E coli t.pdf
ADITIHERBAL
 
A football team consists of 19 each freshmen and sophomores .pdf
A football team consists of 19 each freshmen and sophomores .pdfA football team consists of 19 each freshmen and sophomores .pdf
A football team consists of 19 each freshmen and sophomores .pdf
ADITIHERBAL
 
A frequency table of grades has five classes A B C D F.pdf
A frequency table of grades has five classes A B C D F.pdfA frequency table of grades has five classes A B C D F.pdf
A frequency table of grades has five classes A B C D F.pdf
ADITIHERBAL
 
A frequently heard complaint about merit raises is that they.pdf
A frequently heard complaint about merit raises is that they.pdfA frequently heard complaint about merit raises is that they.pdf
A frequently heard complaint about merit raises is that they.pdf
ADITIHERBAL
 
A factor favoring the success of disruptive innovation is th.pdf
A factor favoring the success of disruptive innovation is th.pdfA factor favoring the success of disruptive innovation is th.pdf
A factor favoring the success of disruptive innovation is th.pdf
ADITIHERBAL
 
A family with an interesting distribution of Leigh syndrome .pdf
A family with an interesting distribution of Leigh syndrome .pdfA family with an interesting distribution of Leigh syndrome .pdf
A family with an interesting distribution of Leigh syndrome .pdf
ADITIHERBAL
 
A firms base pricing strategy establishes the initial price.pdf
A firms base pricing strategy establishes the initial price.pdfA firms base pricing strategy establishes the initial price.pdf
A firms base pricing strategy establishes the initial price.pdf
ADITIHERBAL
 

More from ADITIHERBAL (20)

A Health Behaviour in Schoolaged Children study found that .pdf
A Health Behaviour in Schoolaged Children study found that .pdfA Health Behaviour in Schoolaged Children study found that .pdf
A Health Behaviour in Schoolaged Children study found that .pdf
 
a Identify all NE throughout 3 you are only required to p.pdf
a Identify all NE throughout 3 you are only required to p.pdfa Identify all NE throughout 3 you are only required to p.pdf
a Identify all NE throughout 3 you are only required to p.pdf
 
A hoverboard is a levitating board similar in shape and size.pdf
A hoverboard is a levitating board similar in shape and size.pdfA hoverboard is a levitating board similar in shape and size.pdf
A hoverboard is a levitating board similar in shape and size.pdf
 
A hospital is trying to cut down on emergency room wait time.pdf
A hospital is trying to cut down on emergency room wait time.pdfA hospital is trying to cut down on emergency room wait time.pdf
A hospital is trying to cut down on emergency room wait time.pdf
 
A healthy female Labrador retriever was mated with two healt.pdf
A healthy female Labrador retriever was mated with two healt.pdfA healthy female Labrador retriever was mated with two healt.pdf
A healthy female Labrador retriever was mated with two healt.pdf
 
A hypertonic solution is prepared by the addition of sucrose.pdf
A hypertonic solution is prepared by the addition of sucrose.pdfA hypertonic solution is prepared by the addition of sucrose.pdf
A hypertonic solution is prepared by the addition of sucrose.pdf
 
A group of employees of Unique Services will be surveyed abo.pdf
A group of employees of Unique Services will be surveyed abo.pdfA group of employees of Unique Services will be surveyed abo.pdf
A group of employees of Unique Services will be surveyed abo.pdf
 
A Genler aras sekanslar insan genomunun gt60n oluturur.pdf
A Genler aras sekanslar insan genomunun gt60n oluturur.pdfA Genler aras sekanslar insan genomunun gt60n oluturur.pdf
A Genler aras sekanslar insan genomunun gt60n oluturur.pdf
 
a Given that XX1X2Xn represents a random sample of .pdf
a Given that XX1X2Xn represents a random sample of .pdfa Given that XX1X2Xn represents a random sample of .pdf
a Given that XX1X2Xn represents a random sample of .pdf
 
A genetic disorder shows cytoplasmic inheritance A heteropl.pdf
A genetic disorder shows cytoplasmic inheritance A heteropl.pdfA genetic disorder shows cytoplasmic inheritance A heteropl.pdf
A genetic disorder shows cytoplasmic inheritance A heteropl.pdf
 
A generic queue is a general queue storage that can store an.pdf
A generic queue is a general queue storage that can store an.pdfA generic queue is a general queue storage that can store an.pdf
A generic queue is a general queue storage that can store an.pdf
 
A formal often temporary partnership involving two or more.pdf
A formal often temporary partnership involving two or more.pdfA formal often temporary partnership involving two or more.pdf
A formal often temporary partnership involving two or more.pdf
 
A Galup Roll released in December 2010 asked 2500 adults INi.pdf
A Galup Roll released in December 2010 asked 2500 adults INi.pdfA Galup Roll released in December 2010 asked 2500 adults INi.pdf
A Galup Roll released in December 2010 asked 2500 adults INi.pdf
 
A functional genomics experiment is carried out in E coli t.pdf
A functional genomics experiment is carried out in E coli t.pdfA functional genomics experiment is carried out in E coli t.pdf
A functional genomics experiment is carried out in E coli t.pdf
 
A football team consists of 19 each freshmen and sophomores .pdf
A football team consists of 19 each freshmen and sophomores .pdfA football team consists of 19 each freshmen and sophomores .pdf
A football team consists of 19 each freshmen and sophomores .pdf
 
A frequency table of grades has five classes A B C D F.pdf
A frequency table of grades has five classes A B C D F.pdfA frequency table of grades has five classes A B C D F.pdf
A frequency table of grades has five classes A B C D F.pdf
 
A frequently heard complaint about merit raises is that they.pdf
A frequently heard complaint about merit raises is that they.pdfA frequently heard complaint about merit raises is that they.pdf
A frequently heard complaint about merit raises is that they.pdf
 
A factor favoring the success of disruptive innovation is th.pdf
A factor favoring the success of disruptive innovation is th.pdfA factor favoring the success of disruptive innovation is th.pdf
A factor favoring the success of disruptive innovation is th.pdf
 
A family with an interesting distribution of Leigh syndrome .pdf
A family with an interesting distribution of Leigh syndrome .pdfA family with an interesting distribution of Leigh syndrome .pdf
A family with an interesting distribution of Leigh syndrome .pdf
 
A firms base pricing strategy establishes the initial price.pdf
A firms base pricing strategy establishes the initial price.pdfA firms base pricing strategy establishes the initial price.pdf
A firms base pricing strategy establishes the initial price.pdf
 

Recently uploaded

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
Special education needs
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Sourabh Kumar
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
parmarsneha2
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 

Recently uploaded (20)

Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 

A group of n people were removed from the hotel After a mon.pdf

  • 1. A group of n people were removed from the hotel. After a month, the kidnappers need to get rid of these people, but they just don't want to let them go. They inform the hostages one evening that the next morning they will be lined up one behind the other so that everyone sees those in front of them but none behind. Then the captors will pass, starting with the last in line, and put a hat on everyone's head, either red or black. Hats put down, the kidnappers will come back, always starting at the end of the line, asking the simple question: what color hat do you have?. If the person gives the correct color, they will be released. Otherwise, it will be executed instantly. The only answer allowed (one that will not cause the responder to execute) is the color, black or red. (a) How many people can be saved and how? Explain in detail (a formal proof but not necessary at this time). (b) Give (draw) an AFD that models the rescue protocol, with its interpretation. Pay attention to the alphabet and the states. 2. Give a context-free grammar that generates the language L = {w {(,)} : w is parenthesis}. Prove your answer.