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

(1) The booking limits for four fare classes are given as b = (bi, b2, b3, b4) =

ID: 349029 • Letter: #

Question

(1) The booking limits for four fare classes are given as b = (bi, b2, b3, b4) = (20, 15, 5, 2). Suppose that until now 5 bookings are made for class 2 and 4 bookings are made for class 3 The following parts are independent a) Process a request for 2 bookings for class 4. Decide on accept/reject and then report the cumulative booking vector B b) Process a request for 6 bookings for class 1. Decide on accept/reject and then report the cumulative booking vector B c) Process a request for 2 bookings for class 3. Decide on accept/reject and then report the cumulative booking vector B d) Process a cancellation of 2 bookings for class 3. Report the cumulative booking vector B. (2) The booking limits for four fare classes are given as b = (bi, b2, b3, b) = (20, 15, 5, 2). Suppose that until now 5 bookings are made for class 2 and 4 bookings are made for class 3 The following parts are dependent a) Process a request for 2 bookings for class 4. Decide on accept/reject and then report the cumulative booking vector B b) Process a request for 6 bookings for class 1. Decide on accept/reject and then report the cumulative booking vector B c) Process a request for 2 bookings for class 3. Decide on accept/reject and then report the cumulative booking vector B d) Process a cancellation of 2 bookings for class 3. Report the cumulative booking vector B

Explanation / Answer

1)

b=(b1,b2,b3,b4)=(20,15,5,2)

5 booking for class 2:

x=(x1,x2,x3,x4) = (5,5,0,0)

class 2 bookings are restricted by b2=15, and b1=20.

current bookings, b=(5,5,0,0)

4 bookings to class 3:

current bookings, b = (5,5,0,0)+(4,4,4,0)=(9,9,4,0)

a) 2 booking for class 4:

x=(2,2,2,2)

current booking = (9,9,4,0)+(2,2,2,2) = (11,11,6,2)

Reject the booking as x3=6 exceeds b3=5.

Cumulative booking vector B = (9,9,4,0)

b) 6 bookings in class 1:

x=(6,0,0,0)

b= (9,9,4,0)+(6,0,0,0) = (15,9,4,0)

Accept the booking as (x1,x2,x3,x4)<(b1,b2,b3,b4)

Cumulative booking vector B = (15,9,4,0)

c) 2 booking for class 3:

x=(2,2,2,0)

b= (9,9,4,0)+(2,2,2,0) = (11,11,6,0)

Reject the booking as x3=6 exceeds b3=5.

Cumulative booking vector B = (9,9,4,0)

d) Cancellation of 2 bookings for class 3:

x=(-2,-2,-2,0)

b= (9,9,4,0)+(-2,-2,-2,0) = (7,7,2,0)

Cumulative booking vector B = (7,7,2,0)

1)

b=(b1,b2,b3,b4)=(20,15,5,2)

5 booking for class 2:

x=(x1,x2,x3,x4) = (5,5,0,0)

class 2 bookings are restricted by b2=15, and b1=20.

current bookings, b=(5,5,0,0)

4 bookings to class 3:

current bookings, b = (5,5,0,0)+(4,4,4,0)=(9,9,4,0)

a) 2 booking for class 4:

x=(2,2,2,2)

current booking = (9,9,4,0)+(2,2,2,2) = (11,11,6,2)

Reject the booking as x3=6 exceeds b3=5.

Cumulative booking vector B = (9,9,4,0)

b) 6 bookings in class 1:

x=(6,0,0,0)

b= (9,9,4,0)+(6,0,0,0) = (15,9,4,0)

Accept the booking as (x1,x2,x3,x4)<(b1,b2,b3,b4)

Cumulative booking vector B = (15,9,4,0)

c) 2 booking for class 3:

x=(2,2,2,0)

b= (9,9,4,0)+(2,2,2,0) = (11,11,6,0)

Reject the booking as x3=6 exceeds b3=5.

Cumulative booking vector B = (9,9,4,0)

d) Cancellation of 2 bookings for class 3:

x=(-2,-2,-2,0)

b= (9,9,4,0)+(-2,-2,-2,0) = (7,7,2,0)

Cumulative booking vector B = (7,7,2,0)