Question

Men, women and gupi live on the planet Alphaomega. Imagine you are travelling by a self...

Men, women and gupi live on the planet Alphaomega. Imagine you are travelling by a self driving car on this planet and you need to pass the city Beth. The road goes through this city and you cannot bypass it. There are only two entrances to the city – one from the side you are coming and another from the opposite side. Besides, you know that an evil gupi is sitting at one of the intersections in Beth. When a human being comes close to him, he kidnaps this person and makes the human being his slave. Fortunately, this gupi is lazy and he kidnaps only those who come close to him. The distance in one block is safe for you because your car can feel the presence of the gupi one block ahead of it. At the same time, other inhabitants of Beth cannot help you because you don’t know their language and they don’t know your language. Besides, you don’t have a map of the city Beth.

a) Is it always possible to go through the city? Prove that your answer is correct.

b) If it is always possible to go through the city, design an algorithm for your car for doing this.

c) If it is not always possible to go through the city, design an algorithm for your car that will allow you to go through the city when it is possible or to return back when it is impossible.

Homework Answers

Answer #1

It is possible to go through the city, because we can detect the presence of guppi from one block away and hence we can choose another path.

There is one case, in which, passing the city becomes impossible, that is when guppi is sitting at the last intersection from which we need to pass through.

Algorithm for passing the city whenever possible and returning if not.

while( the city is not passed)

if( block_ahead there is guppy )

if(block_ahead is the last_intersection_to_pass)

return back from the city

if(block_ahead is not the last intersection)

return and try different route

if( block_ahead there is no guppy)

keep_moving

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Men, women and yupi live on the planet Alphaomega. Their family pattern is a triple that...
Men, women and yupi live on the planet Alphaomega. Their family pattern is a triple that consists of a man, a woman and a yupi. Three sets are given: M includes n men, W includes n women and Y includes n yupi. A matching is a set H of ordered triples of the form (m, w, y) with the property that each member of M, each member of W and each member of Y appears in at most one triple...
§ Comment your code - you will be glad you did. You will be reusing code...
§ Comment your code - you will be glad you did. You will be reusing code throughout the semester. § You will demo each of your projects. In each demo, you will be asked to demonstrate the functionality of the program and possibly describe how some of the code works. Be prepared for this. § You will upload your projects on Blackboard. Details about this will be announced in class. § Late projects will lose points: 20% per day of...
How do you relate the most to this story and why? In two strong paragraphs, explain...
How do you relate the most to this story and why? In two strong paragraphs, explain what it is about the tone and/or imagery of the story that speaks to you and why. Use some text examples to support your response Hills Like White Elephants (1927) The hills across the valley of the Ebro1 were long and white. On this side there was no shade and no trees and the station was between two lines of rails in the sun....
You have landed a great summer job in the medical school assisting in a research group...
You have landed a great summer job in the medical school assisting in a research group investigating short-lived radioactive isotopes which might be useful in fighting cancer. Your group is working on a way of transporting α-particles (Helium nuclei) from where they are made to another room where they will collide with other material to form the isotopes. Since the radioactive isotopes are not expected to live very long, it is important to know precisely how much time it will...
Ron Davis, the relatively new general manager of the machine tooling group at Parker Manufacturing, was...
Ron Davis, the relatively new general manager of the machine tooling group at Parker Manufacturing, was visiting one of the plants. He scheduled a meeting with Mike Leonard, a plant manager who reported to him. RON: Mike, I’ve scheduled this meeting with you because I’ve been reviewing performance data, and I wanted to give you some feedback. I know we haven’t talked face-to-face before, but I think it’s time we review how you’re doing. I’m afraid that some of the...
Kirby walked into Nancy’s office and said, “I need to talk to you.” He then closed...
Kirby walked into Nancy’s office and said, “I need to talk to you.” He then closed the door and said, “I didn’t appreciate it when you challenged my new production scheduling plan in the meeting. If you had real concerns, why didn’t you wait to talk to me in private? It’s embarrassing to have someone trash my ideas and I don’t want it to happen again.” Nancy, taken by surprise by Kirby’s response replied, “Well, I’m sorry if I embarrassed...
“Great course, Sam!” said the trainees as they walked out the door and headed for the...
“Great course, Sam!” said the trainees as they walked out the door and headed for the parking lot. Just like all the others. Sam Harris, a veteran trainer with Flotation Ltd., a manufacturer of life jackets and other flotation devices, smiled as he gathered his notes together. He had just finished two hours of wisecracking and slightly off-colour storytelling as he worked his way through the third session of a human relations course for supervisors. “Keep ‘em happy” was Sam’s...
Probability and Genetics Lab In heredity, we are concerned with the occurrence, every time an egg...
Probability and Genetics Lab In heredity, we are concerned with the occurrence, every time an egg is fertilized, of the probability that a particular gene or chromosome will be passed on through the egg, or through the sperm, to the offspring. As you know, genes and chromosomes are present in pairs in each individual, and segregate as they go into the gametes (egg and sperm). There are two possible genes (alleles) that the egg or sperm might obtain from each...
Description In this project you will practice what we have learned in class about Design, ER...
Description In this project you will practice what we have learned in class about Design, ER Diagrams, Relational Models, DDL, SQL, CRUD (Create, Update, Delete) operations, associated queries, and mock data population. The goal is to create a realistic professional database/development experience. This assignment will describe the requirements for the database as you might receive them. You will need to fill in the details as you work on it. You will find that your work may be iterative, and you...
Probability and Genetics Lab In heredity, we are concerned with the occurrence, every time an egg...
Probability and Genetics Lab In heredity, we are concerned with the occurrence, every time an egg is fertilized, of the probability that a particular gene or chromosome will be passed on through the egg, or through the sperm, to the offspring. As you know, genes and chromosomes are present in pairs in each individual, and segregate as they go into the gametes (egg and sperm). There are two possible genes (alleles) that the egg or sperm might obtain from each...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT