We store the daily numbers of newly infected people with some virus (new infections, below) in a text file in chronological order. The numbers are separated by colons (:). For example, when the numbers of new infections for 5 days are
(1) Let be the numbers of new infections on every day stored in the text file infections.txt. We define the following function
where .
Calculate the maximum and minimum values of and write them on the answer sheet. Furthermore, calculate the sum and write it on the answer sheet. Round those values to 4 decimal places.
(2) Let and be the numbers of new infections stored in text files and , respectively (). We define , the similarity score between these two files, as
where .
Among arbitrary pairs of two files in the folder data, find the pair with the highest similarity score and write the two file names on the answer sheet. Furthermore, write the similarity score on the answer sheet. When more than one such pair is found, write all the pairs and their scores.
(3) Let be the numbers of new infections stored in the text file infections2.txt. These numbers are denoted by .
We find the approximate formula that has a good fit to these numbers . For example, the approximate value for is . Here, and are the constants that minimize the error for . They are calculated as follows.
where represents .
Calculate and rounded to 4 decimal places and write them on the answer sheet.
(4) Let be the numbers of new infections stored in the text file infections2.txt. For a given , a sub-sequence of these numbers is denoted by . Here, .
We find the approximate formula that has a good fit to a sub-sequence . For example, the approximate value of is . Here, and are the constants that minimize this error
for .
Find such that it maximizes the value of in the approximate formula for . Write the values of for such on the answer sheet. Round and to 4 decimal places. When more than one such is found, write the values of for every .