Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3. (20 Points, 4 each) Consider a school with five classes: A, B, C, D, E. The courses can be scheduled in two periods,

Problem 3. (20 Points, 4 each) Consider a school with five classes: A, B, C, D, E. The courses can be scheduled in two periods, named 1 and 2. Each class needs to be scheduled in one of the two periods, but there are some caveats. Some subsets of courses can not be scheduled in the same period because some students need to take both classes. There will be ten variables, one for each course/period combination. For example, for class A, there are a1 and a2. If a1=True this means that class A is scheduled in period 1. 1 Write all your functions in the following parts in python. Each function should output True when the required condition is met. Note: Place all the functions in a single python file and make sure to name your python file ps3.py for the auto-grader to recognize and compile the file. Also, do not include any print statements or header documentation in the file. Use function names as required by each question.

a) Define a function a(a1, a2, b1, b2, c1, c2, d1, d2, e1, e2). Each of the five classes must be scheduled in either period 1 or period 2, but not both.

b) Define a function b(a1, a2, b1, b2). Class A and B cannot be scheduled in the same period.

c) Class B and E cannot be scheduled in the same period, or Class B and C cannot be scheduled in the same period.

d) Define a function d(a1, a2, c1, c2, e1, e2). The three classes A, E, and C cannot be scheduled in the same period.

e) Define a function e(a1, a2, d1, d2). Class A and D must be scheduled in the same period.

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

Contemporary Issues In Database Design And Information Systems Development

Authors: Keng Siau

1st Edition

1599042894, 978-1599042893

More Books

Students also viewed these Databases questions

Question

What are some of the common alloy elements added to steel?

Answered: 1 week ago

Question

Define channel capacity.

Answered: 1 week ago

Question

Analyse the various techniques of training and learning.

Answered: 1 week ago