Computer Science Paper 2 HL Markscheme
Computer Science Paper 2 HL Markscheme
Markscheme
November 2017
Computer science
Higher level
Paper 2
26 pages
–2– N17/4/COMSC/HP2/ENG/TZ0/XX/M
Option A — Databases
Example answer 1
A database transaction is a logical unit that is independently executed;
For data retrieval or updates;
Example answer 2
A database transaction is a unit of work;
That is either executed in full or not executed at all;
Example answer 3
A database transaction is a way of representing a state change;
And has four properties, known as ACID;
Example answer 4
A database transaction usually means a sequence of steps, treated as a unit;
For the purposes of satisfying a client’s request;
Example answer 5
A database transaction is a process carried out on a database;
Which may change its state, for example: moving money between bank
accounts; [2]
Example answer 1
Durability is important because transaction data changes must be available;
Even in the event of database failure;
Example answer 2
Durability means that if the system says the transaction has been committed;
The client does not need to worry about it because transactions that have been
committed will survive permanently;
Example answer 3
Durability in databases is an important property because it ensures transactions
are saved permanently;
And do not accidentally disappear or get erased; [2]
(d) Award [1] for stating what a data dictionary is and up to [3 max] for describing its
contents.
They do not contain any actual data from the database, it contains only
information for managing it (without a data dictionary a DBMS cannot access
data from the database);
Data dictionaries are usually hidden from users to prevent them from
(accidentally) deleting/changing/destroying its contents; [4]
Example answer 1
Data is a raw fact, for example, “Joe Skrin” is data/a string;
Whilst information is data which has meaning;
In this table “Joe Skrin” is the name of an art student/who had an examination/
who passed an examination;
Example answer 2
For example, number 99 is data;
In this database, total 99 is information;
Because it has meaning, it represents a student’s mark/it shows that the student
failed; [3]
(b) (i) An entity is some unit of data that can be classified and has stated
relationships to other data units;
A real-world object with attributes that is represented as data in a database; [1]
(ii) In relation to given example, the entity is a single student about whom data
can be stored as a record in this relation; [1]
(d) Award up to [4 max]. Award [1] for stating the purpose of data verification and
[1] for further explanation, up to [2 max]. Award [1] for stating the purpose of
data verification and [1] for further explanation, up to [2 max].
Example answer 3
Total is a validated field;
Therefore, if all the individual test fields are validated, the Total value will
automatically be within the specified range;
(f) (i) Award [1] for selecting the correct field from the table and [1] for a correct
comparison, up to [2 max].
Example answer 1
SELECT Student_ID FROM Class_Table
WHERE Exam_One >= 30 and Exam_Two >= 30 and
Exam_Three >= 30 and Total >= 150
Example answer 2
SELECT Student_ID FROM Class_Table
WHERE not (Exam_One < 30 or Exam_Two < 30 or
Exam_Three < 30 or Total < 150) [4]
(ii) Award [1] for identifying an issue caused by data redundancy and [1] for a
brief explanation up to [2 max].
(c) Award [1] for identifying why a compound key is used for the
SCHOOL_VOLUNTEERS relation and [1] for a brief explanation up to [2 max].
Are used because it is not possible to designate a primary key from a single field;
Neither the code nor the date field on their own uniquely identify a record;
Is based on two primary keys in other tables; [2]
Example answer 1
2NF = 3NF if there are no transitive relationships/if any non-key attributes are
more dependent on another non-key attribute than the key field;
Schools_Table could be the above if a school had more than 1 address;
Then the Address would depend upon the School_Name;
And the Schools_Table code would be split as follows:
(Code, School_Name)
(School_Name, Address);
If the school had only 1 address then 2NF = 3NF;
The Volunteers_Table has no transitive dependencies;
There is no redundant data;
Example answer 2
A relation is in 3NF if it is in 2NF and it contains no transitive dependencies;
From the 2NF (two created relations above) the functional dependencies are not
evident in the relation School_Table (School_Name, Code, Address):
(c) (i) Database segmentation means dividing entities into groups with similar
characteristics/common attributes; [1]
(ii) Award [1] for identifying a benefit and [1] for a further explanation,
up to [2 max].
Benefit
Increased profit;
Better reputation;
Increased number of customers;
Better opportunities for growth;
To gain a larger share of the market;
Explanation
By studying the groups and behaviour of the customers in the group (for
example, average call time of customers younger than 30 or which services
are purchased by customers older than 60, etc);
The company will better understand customers and serve them better;
Can better decide which marketing actions should be taken;
Can better predict which group of customers new products/services should
be offered to;
Can better decide which new products/services are needed; [2]
(f) Award [1] for creating a model and [1] for detecting changes/differences in the
data/model from previously measured values, up to [2 max].
Example answer
The customer call records and calling behaviour (other activities) could be
summarized to obtain their calling pattern;
The (previous) calling pattern could be compared with the customers’ recent
call/activity;
In case of significant changes/differences the activity is suspicious/fraud
detected; [2]
– 10 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
(g) Award [1] for creating a statistical model, [1] for analysing the model and
forecasting probabilities/trends and [1] for an appropriate example in the given
situation.
Example answer 1
Customer’s online behaviour pattern could be created and considered;
Customers who spend less time logged on may be less likely to renew their
annual subscription;
In this case, the ability to keep the customer can be increased by offering
new/better/cheaper services and products;
Example answer 2
Customer’s calling pattern could be created and analysed;
If, for example, the customer has high monthly usage of services then the
customer will probably renew his annual subscription;
(No actions made by the company needed);
If a customer is younger than 20, may spend more time exploring new service
features, and the customer is at a greater risk to cancel the contract/the customer
will probably not renew annual subscription;
(Actions made by the company might be needed, for example: offering new/better
services and products;) [3]
– 11 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
Each sheet will contain a list of items for that category including associated
values;
Formulas will be included as necessary;
Each sheet/category will include a formula that totals the values in that category;
Intermediate values will be calculated, eg tax to be paid;
The final profit will be determined from the previous totals; [6]
(b) Figures from previous years can be entered into the model;
With the results checked against the previously calculated results; [2]
(b) Only the major/known variables can be input into the model;
Approximations have to be made to represent complex processes;
These or other minor/unknown variables will not have a significant effect in the
short term;
But will have (unknown) effects in the long-term/small errors have a cumulative
effect over the long-term/butterfly effect; [4]
(c) Award [1] for each valid point discussed, and a further [1] up to [5 max] for a
good expansion of this point.
Investigate past weather patterns in order to see if past forecasts were correct or
not and make adjustments to your model appropriately;
Look at specific events in the past (eg appearance of El Nino) to see how they
affected future weather patterns in different areas, and then apply this to new
occurrences of these events;
However, historical data does not take into account new factors, such as how
carbon emissions are contributing to global warming; [5]
(ii) Standard simulations produce numerical values (which are not easily
understood by the general public);
Modern simulations include
Graphics that are related to the data output;
eg rain drops/a smiling sun;
CGI/animation can produce motion;
eg showing a belt of rain crossing the country;
Which are more easily understood by the general public; [6]
– 13 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
Example answer
The statistical model involves comparing the text to be translated against previously
stored sets of text pairs (eg English and its French equivalent) and then selecting the
most probable translation;
The cognitive model involves establishing all the rules of each of the languages and
then breaking down each section of text to establish its grammatical structure and then
replacing the text with text that has an equivalent structure from the other language;
The second approach has not proved particularly successful for two reasons. The first
is that the process of establishing a clear set of rules is extremely labour intensive.
The second is that the process can be ruined by the problems of context, double
meanings and non-standard language;
The first approach was taken because the company has stored an enormous set of
validated text in different languages and the increase in processing power which allows
this corpus to be searched and processed; [5]
– 14 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
Advantages
It saves time (in web development);
Because modification of style needs to only be made to the CSS;
It saves space;
Because the code (of the style) is not repeated in each HTML file;
Quicker load of many pages / Quicker download of many pages from the same
site;
HTML files are smaller;
It gives a uniform appearance to the entire website;
Which makes it more attractive/appealing/easy to navigate;
It can be integrated with outside sources (eg RSS feeds);
Which makes the website more interactive/dynamic for the user;
Quicker to make changes to layout/formatting/page positioning;
Therefore, it helps separating the jobs/tasks of illustrators (designer) from those
that produce content;
Increases accessibility of authoring to non-experts;
Supported by most browsers;
Increasing the number of users;
Disadvantages:
Downloading pages from different sites can be slow (general browsing);
Because each page may have its own CSS;
(However, downloading many pages from the same site is instead faster;)
CSS syntax is different from HTML and can be slightly ambiguous;
Not a user-friendly language (but available as IDE) that the developer needs to
learn;
(eg the same cascade style name may have slightly different effects when used
by different browsers;)
An HTML page saved without CSS, and seen offline, will not display nicely;
Because it would require access to external files, including CSS (including
images, video, sound);
Anybody with read/write permission to the CSS can easily override just the CSS;
Showing unwanted information to an entire web-site (risk of hacking in just one
point/internal threat with high risk);
Some browsers do not support exactly the same CSS (some styles/fonts for
example);
The view can be slightly different using different browsers/risk of slight
incompatibility;
(For large, corporate sites) Integration of HTML + CSS with other content
management systems (CMS) may be tricky;
Because CMS also use their own CSS, and there can be collisions, and it
requires technical competence; [6]
– 15 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
TCP uses the header of the data packets to order them and to check their
contents;
And sends an acknowledgement signal to the transmitter upon correct
reception, before preparing a new data packet with a further header for the
IP/Internet level;
If the transmitter does not receive the acknowledgement from the TCP, the
transmitter re-sends the packet;
Therefore, all correct packets will be available to the TCP at some point to be
made available to the IP and specifically to the IP destination/receiver (in the
header);
IP ensures that the package reaches the correct address; [3]
(c) (i) Award [1] for stating how the URL is generated, and [1] for giving an
example, up to [2 max].
It is generated by taking the path of the website extended with the path for
the code;
eg www.OpenSourceDev.org/newcode/json/fakecode007; [2]
(ii) The script accesses the file of new URLs (in a file);
And adds the URLs to an email template;
Then accesses the file of email addresses of subscribers (and sends
email); [3]
(d) Award marks as follows, up to [3 max]. (Note: there are [5] marking points)
Award [1] for the value passing from the form to php via POST.
Award [1] for the operation of the code to generate the short URL with final $v.
Award [1] for access to update database.
Award [1] for a new correct triple in database.
Award [1] for remote access operated by server through the database to retrieve
the URL.
Note: Competent use of terminology is needed to award full marks. Generic
answers that show general good understanding of the process, but lack use of
competent language should not be awarded full marks.
Example
The value of the URL that is inputted (and submitted) via the form is stored in the
variable URL which Interacts with the php code, because the method POST is
specified in the form, therefore starting a communication process;
The process generates a different value for the name for the URL that is used to
update a database of URLs together with the IP address;
The IP address is retrieved by the server through a remote call requested from
the insertion in database;
The new value for the URL that is generated, given the one in input, is
thenhpid.td and is stored in $v;
(detail of intermediate operations:
$x = thendorgbinphpid
$y = thenhpid
$z = td
$v = thenhpid.td)
The new record inserted in the database url_db will be the following triple
www.the2nd.org/bin.php?id=70, thenhpid.td, 172.16.254.1; [3]
– 17 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
(b) Award [1] for identifying a service and [1] for stating a benefit, for two services
up to [4 max].
Use of correct keywords allows the search engine to search and find those terms;
For Example
Title tags / keywords associated to the title of the page;
A description with tags may induce more visitors to visit the page;
Other keywords that appropriately refer to the content of the web;
(Even irrelevant keywords or hidden content however keyword stuffing might
actually be punished by more recent algorithms for ranking);
Meta attributes for robots (such as follow/nofollow, index/noindex) that give
indication about whether or not to index the page;
Meta language descriptors (for example to recognize in some language rather
than English) to appropriately index content based on the dictionary of that
language;
This is related to indexing, because web crawlers visit pages and inspect their
content based on the terms that they have to search;
The ranking algorithms give value to the pages once that they are indexed, based
on parameters that depend also on the ease of retrieving the pages/number of
authoritative in-links/number of hits (or visitors);
The Search Engine can be optimized so that the best use of meta-tags can be
made with the objective of indexing and ultimately ranking; [3]
– 19 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
(c) No;
Because 2 reaches the node 3 that is in the SCC; [2]
(e) 4 [1]
(Incrementality of web): Number of nodes in the web increases (nodes are not
deleted) / New nodes (documents) have hyperlinks that connect to existing nodes
in the web;
(Nodes are not deleted, but) some of the hyperlinks in documents may be
changed/deleted/break over time, this may produce isolated nodes;
Therefore, a few nodes receive many in-links (because many nodes link to them
directly or indirectly based on preference), whereas nodes that have a few
in-links are probably new;
Note: Do not accept: LED light and permanent supply of power, as they are not
directly related to CS/IT.
For example
Discussion on privacy/monitoring
Data on hotspots are provided by telecom companies;
These data should already be the result of some analysis and be stripped of any
private (personal) information;
However, the company that controls the illumination would still have information
on where the crowd is (in addition to the telecom) and this poses an issue of
crowd monitoring;
In both cases, private data shall not be made available and authorities and
protocols should be used to guarantee which level of service these ubiquitous
solutions provide;
Governments may obtain this information to track the whereabouts of individuals; [4]
– 21 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
15. (a) Award [1] for identifying the code and [1] for identifying the new position.
private int fiCount = 0 and private int diCount = 0;
In the variable/attribute section of the class and not in the constructor); [2]
(b) EITHER
The values of these (static) variables;
Are the same for all objects;
They belong to the class (not to the objects);
And are only created/declared once;
Note: Do not accept “cannot be changed”.
OR
The static methods;
Are class methods (not object methods);
Are independent of the objects in the class; [2]
(c) Award [2 × 2] for each clear example. Only award [2] for an example if the
benefit is clearly shown;
Having different data types allow different operations to be carried out depending
upon the type;
eg
Calculations in the integer “quantity” variable;
which are not possible for a String;
Note: Ignore minor syntax errors in both parts (b)(i) and (b)(ii).
has a
FoodItem
Payment
has a
DrinkItem
uses
Item
[3]
(b) Award [1] for identifying a feature, [1] for an example in the given context, and [1]
for an elaboration, for two features up to [6 max].
Encapsulation places all attributes and methods that relate to a particular
object/entity together;
For example, Payment class includes attributes such as the food and drink arrays
and methods such as calculateBill();
This provides a clearer view/understanding of each section of the problem;
Which can lead to more efficient programming (faster, less errors etc);
Encapsulation protects the values of the data stored within the object;
From (accidental) changes made by other classes;
For example, quantity in the FoodItem class cannot be altered through another
variable called quantity in another class;
This allows programmers to select any variable names they wish/no restriction on
choice of variable names; [6]
Note: Allow a similar answer that deals with the different items (FoodItem,
DrinkItem etc). [4]
– 25 – N17/4/COMSC/HP2/ENG/TZ0/XX/M
18. (a) Memory space for the exact number of objects can be assigned;
Whereas the array will (inevitably) waste space/allot more memory than is
needed/may run out of allotted memory/there is no need to determine array size; [2]
Example 1
Example 2
(b) The base case will return true if the length of word = 0 or 1 (must have both values) /
The index of last character <= index of the first character;
Otherwise the first and last letters will be compared;
Returns false if they are not equal;
If they are equal, calls the method again;
With, as its parameter, the word stripped of its first and last letters (can use
indices); [5]