Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Cinderella-Stepmother problem is a two-player game, in which Cinderella and Stepmother take turns to take actions. Cinderella has 4 water buckets, initially empty, arranged

image text in transcribed

image text in transcribedimage text in transcribed

The Cinderella-Stepmother problem is a two-player game, in which Cinderella and Stepmother take turns to take actions. Cinderella has 4 water buckets, initially empty, arranged in a circle. In each turn, Cinderella first chooses to empty 2 adjacent buckets. Afterwards, Stepmother adds up to 4 liters of water to the buckets, and can distribute the water arbitrarily over the buckets in multiples of 1 liter of water. After Stepmother's action, the game proceeds to the next turn. Every bucket has a capacity of 8 liters, and it is Cinderella's objective to avoid any bucket being overflown. Figure 2 shows a partial model for the Cinderella-Stepmother problem. The model assumes that the buckets are labeled 0 to 3, and increased in the clockwise direction (until bucket 3 meets bucket 0). Variable pour_i represents the number of liters of water that Stepmother pours into the ith bucket in each turn, and bucket_i represents the number of liters of water in the ith bucket at the beginning of each turn. If the value of bucket_i is less than or equal to 8, it means that the ith bucket has bucket_i liters of water. If its value is 9, then the bucket is overflown. Variable empty represents the bucket (and its clockwise neighbor) that Cinderella wants to empty at each turn. Variable gamestate becomes-1 only when Cinderella lose the game (the water in a bucket is overflown); otherwise or it is 0. The first four constraints specify that every bucket is empty initially. The next constraint means that Stepmother can add no more than 4 liters of water into the buckets in each turn. There are two constraints for variable gamestate. The constraints say that gamestate is 0 initially, and it becomes -1 if and only if 1) Cinderella has already lost the game, or 2) one of the buckets is overflown Complete the model in Figure 2 by filling in the missing parts (...) of the last 4 constraints, which specify the amount of water in each bucket at the beginning of the next time point (that means the end of a turn) after the different actions taken by Cinderella and Stepmother // stream variables declarations // liters of water that Stepmother pours into each bucket var pour.0: [0, 4]; var pour 1: [O, 4]; var pour2: [0, 4]; var pour 3: [0, 4]; // liters of water in each bucket at the beginning of each turn var bucket 0: [0, 9]; var bucket 1: [0, 9]; var bucket 2: [0, 9]; var bucket 3: [0, 9]; // the first bucket that Cinderella wants to empty var empty: [0, 3]; // variable to indicates whether Cinderella has lost the game var gamestate: [-1, 0]; // nitial conditions first bucket 00; first bucket-1-= 0; first bucket 2- 0; first bucket 3- 0; first gamestate --0; // Stepmother can only pour 1 liter of water to each bucket // in each turn pour-0 + pour-1 + pour-2 + pour-3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

Describe the medical approach to treatment pioneered by Rush?

Answered: 1 week ago