Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prove every linear combination of sa + tb can be accurately measured using jugs of capacities a, b. It is required that , since the

Prove every linear combination of sa + tb can be accurately measured using jugs of capacities a, b. It is required that image text in transcribed , since the measured amount must fit within one of the jugs. Assume that a

a. Show that if m is a linear combination of a, b then m = sa + tb where s > 0. In other words, every linear combination can be expressed in a manner where the coefficient of the smaller jug is non-negative.

Hint: what happens to the value of the linear combination if we increase s to s+b and decrease t to t-a?

b. Consider the following algorithm, starting with two empty jugs A of capacity a, and B of capacity b, with a

1. Fill jug A.

2. Pour as much water from A into B as possible. If B becomes full, empty it out, and finish pouring any remaining water from A into B.

Show the sequence of states (amount in each jug) at each step if a = 21 and b = 26 until jug B contains exactly 3 units of water. Here are the first few steps:

image text in transcribed

c. Show that when the algorithm is repeated s times, where s satisfies the conditions of part (a) above, that the amount of water in jug B is exactly m. The remarkable conclusion is that not only can every multiple of gcd(a,b) be measured eactly, but we don't even need to know s and t in advance. Simply repeat the 2-step algorithm until you have the desired amount in jug B.

sa tb S mar (a, b) sa tb S mar (a, b)

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

Students also viewed these Databases questions

Question

LO4 Specify how to design a training program for adult learners.

Answered: 1 week ago