Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Study the dining philosopher problem. We have five philosophers locked up ina a

ID: 3865135 • Letter: S

Question

Study the dining philosopher problem. We have five philosophers locked up ina a small room, with endless supply of spaghetti in their plates. Twenty -eight days later, when we unlock the door, how many philosophers might still be alive? Explain your answer. Study the dining philosopher problem. We have five philosophers locked up ina a small room, with endless supply of spaghetti in their plates. Twenty -eight days later, when we unlock the door, how many philosophers might still be alive? Explain your answer.

Explanation / Answer

Before discussing abot the situation let's discuss what Dining Philosopher problem exactly is

Dining Philosopher: So dining philosopher problem states that there are several philosopher's are available on single rounded table and they are here to have some food, but the problem is they have limited number of forks available i.e same number as philosopher's are available and they cannot eat using one fork, a philosopher needs exactly two forks to have food. SO how will they manage and have food.

Well, in dining philosopher's problem there are several scenarios which needs to be discussed in this case:

Please note that it doesn't matter that how much supply of spaghetti is until people are eating them and by people I mean ALL of them

Scenario: 1

In this scenario, what will happen is all the five philosopher's picked up there right fork at the same time. Now, no one has the left fork to eat in this case everyone will starve to death in 28 days, and none of the spaghetti will be consumed irrespective of the supply.

Scenario: 2

In this scenario, what will happen that suppose philosopher's make a pact together to solve this problem and have food since they are starving, what they decide is to have spaghetti alternatively so using four forks two philosopher's sitting in front of each other will take there turn and have delicious spaghetti, but in this case one of our philosopher is sitting ideal observing the whole scene and very soon he will die ho hunger.

Scenario: 3

Here one of our philosopher gets greedy and decides to eat spaghetti on his own will without caring for anybody else,so in this case two of the philosopher's will die of starvation and one greedy philosopher will become way healthy.

Scenario 4:

If we assign a conductor to maintain that no philosopher die, so whenever a fork is required to a philospher he will raise his/her hand left or right for the respective fork and conductor checks whether the forks are available then grant permission to the philosopher's to eat. in this scenario no philosopher will Die. But the problem occurs when all the philosopher's request for the fork at the same time, That situation is called deadlock.