Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Problem Statement For the upcoming world-cup, the Indian Cricket Selection Committee has to come up with a possible batting order for their players. Instead

1. Problem Statement For the upcoming world-cup, the Indian Cricket Selection Committee has to come up with a possible batting order for their players. Instead of using the traditional approach they have decided to use computer algorithms to come up with all the possible batting orders and then decide from that. The algorithm however requires the possible batting positions for each player.

The algorithm takes a list of 11 players. Each player can have more than one position they can bat at. Your job for now is to help the selection committee calculate the total number of unique batting charts such that every player gets exactly one batting position from their list of positions and no two players are given the same batting position in one batting chart.

Requirements:

1. Formulate an efficient algorithm using dynamic programming to perform the above task.

2. Analyse the time complexity of your algorithm.

3. Implement the above problem statement using Python 3.7 I

nput: Input should be taken in through a file called inputPS7.txt which has the fixed format mentioned below using the / as a field separator:

Player / < position 1> / < position 2> / < position 3>. Ex:

P1 / 1 / 2 / 3 / 4

P2 / 1 / 5 / 9 / 2 / 6 / 7 / 8

P3 / 1 / 2 / 7 / 10 / 3

P4 / 1 / 9 / 2 / 6 / 7 / 10 / 3 / 4

P5 / 5 / 9 / 2 / 8 / 3 / 4

P6 / 1 / 5 / 3 / 6

P7 / 6 / 7 / 4

P8 / 1 / 9 / 2 / 4

P9 / 9 / 6 / 11 / 3 / 4

P10 / 1 / 5 / 9 / 7 / 8 / 4

P11 / 6 / 11 / 7 / 10

Note that the input data shown here is only for understanding and testing, the actual file used for evaluation will be different.

Output: Syntax of the output should be: The total number of allocations possible is: Ex: The total number of allocations possible is: 4646. Display the output in outputPS7.txt.

use data structures and wriite necessary comments.

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

Transactions On Large Scale Data And Knowledge Centered Systems Vi Special Issue On Database And Expert Systems Applications Lncs 7600

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Stephen W. Liddle ,Klaus-Dieter Schewe ,Xiaofang Zhou

2012th Edition

3642341780, 978-3642341786

More Books

Students also viewed these Databases questions

Question

Apply your own composing style to personalize your messages.

Answered: 1 week ago

Question

Format memos and e-mail properly.

Answered: 1 week ago