Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Thammasat Science Sports Day ( CstuSportsFest ) Semester 2 , academic year 2 0 2 0 , Thammasat University By Khanajarn Wicha K . P
Thammasat Science Sports Day CstuSportsFest
Semester academic year Thammasat University
By Khanajarn Wicha KP
In the year the Department of Computer Science, Thammasat University, will organize a sports day. For each color, the color supervisor must select athletes of each color to compete in the programming sport. The selection will be considered. "Incompatibility" of the two athletes This mismatch is defined by the similarity of student characteristics. The characteristics of each student are measured by giving. Students answer a number of questionnairesitems Each question will be given a score of or
For example, if a faculty member determines to use a questionnaire with questions as follows:
Do students like to eat Japanese food?
Do students like to exercise or not?
And there were students who answered the questionnaire and the details are as follows.
Student rated item as and rated item as
Student rated item as and rated item as
Student rated Item as and rated Item as
From the query we can use a vector D array of size N
vi vvvvn
To represent the questionnaire responses of the ith student, the member in the vector vi is the score that the student answered in questionnaire number As in the example above, we get that
Student is represented by v
Student is represented by v
Student number is represented by v
From this feature vector, we can find the mismatch of two students v v with the power of Euclidean distance of as follows: Dvv zigmavv where the higher the values of Dvv A high value means that the two students do not get along well. While the higher the value of Dvv the smaller the value means These two students are more likely to get along with each other.
Substituting the values, we can find Dv v
and Dvv
When Dvv Dvv it means that Student is more compatible with Student than Student because of their scores. The incompatibility scores of students and were less than the incompatibility scores of students and
And when we calculated Dvv it was found that students and had the lowest incompatibility scores. That is students and are most compatible with each other. Students and were therefore selected to compete.
sports day
Problems
Have students write a program to help teachers of each color select students by calculating the lowest incompatibility score. So that the two students who will be selected will be as compatible as possible. From a total of M students to participate in the writing competition. The program for the Thammasat Science and Technology Sports Festival follows the criteria above. Assume that all students answer the questionnaire. has been completed with details of the input and output of the program as follows:
ObservationsHints: If you want the program to be able to calculate values correctly. The program must check every possible pair of students. For example, if there are a total of students in a color, the program must check all pairs of students and similar to what was calculated. Calculating from the example above, in the case where there are students, the program must check all pairs of students
input data
The input data has M lines, where M is the total number of students participating in the selection.
Line integer number M and N where N is the number of questionnaire items to measure student incompatibility, where M and N
Lines through M each take an integer N The numbers tell details about responses to queries through N with each value being an integer in the range through
Note: All input data must always have the correct value according to the format, scope, and set of possible values. Students do not need to validate the input data.
Export data
The output data has only one line: the incompatibility score D is always a positive integer. with the least value from students Every couple that is selected In the case where there is more than pair with the same incompatibility score, answer with only incompatibility score.
Example
input data
Export data
Example
input data
Export data
Example
input data
Export data
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started