IB Comp Sci SL - May 26 2017 Lesson Notes

From Computer Science Wiki

Class plan.png What are we going to learn today?[edit]

A local charity organizes a half-marathon to raise money. The rules to participate in the half-marathon are as follows:

  • The organizers limit the total number of participants to 450
  • Participants belong to a team and each team must have at least three and at most five participants
  • Each participant registers for the event independently from the other members of their team, and they all declare their team name when registering
  • For scoring, the team’s final time is the sum of the times of its three fastest participants. Participants that do not cross the finishing line within 2 hours after the start, are assigned a default time of 1000 minutes. The winning team is the team with the smallest sum total.

During registration, an array, PARTICIPANTS, with 450 positions is used to hold the abbreviated team names that are declared by each participant. Simultaneously, a collection TNAMES is generated: any new team name that is declared is added to the collection.

(a) State the minimum size of TNAMES to ensure the names of all potential teams can be stored. [1]

Part of the array PARTICIPANTS is shown below, where, for example, the first participant declared that they are part of team TK. The initial part of the collection TNAMES is also shown, with arrows indicating the direction of growth.

TIMING is initialized to zero before the race starts, and updated with the finishing times for each participant. The algorithm sum3best is able to output the sum of the three fastest times from any group of times that are passed to the algorithm.

(d) Describe the steps of an algorithm that will find the winning team, as determined by the marathon rules clearly mention the use of existing or of new data structures.

Homework.png What is our homework?[edit]

None today

Target.png How am I being assessed today?[edit]

  1. none today

Ourstandards.png Standards we are covering today[edit]

These standards are used from the IB Computer Science Subject Guide[1]

  • Construct suitable representations to illustrate system requirements.

Computer1.png As a computer scientist, you have:[edit]

  • Confidence in dealing with complexity
  • Persistence in working with difficult problems
  • Tolerance for ambiguity
  • The ability to deal with open-ended problems
  • The ability to communicate and work with others to achieve a common goal or solution

Credit.png Credits[edit]

  1. IB Diploma Programme Computer science guide (first examinations 2014). Cardiff, Wales, United Kingdom: International Baccalaureate Organization. January 2012.