<jupyter_start><jupyter_text>Day_8. Least Square Regression Line`Task`A group of five students enrolls in Statistics immediately after taking a Math aptitude test. Each student's Math aptitude test score, `x`, and Statistics course grade, `y`, can be expressed as the following list of `(x, y)` points:```1. (95, 85)2. (85, 95)3. (80, 70)4. (70, 65)5. (60, 70)```If a student scored an `80` on the Math aptitude test, what grade would we expect them to achieve in Statistics? Determine the equation of the best-fit line using the least squares method, then compute and print the value of `y` when `x = 80`.`Input Format`There are five lines of input; each line contains two space-separated integers describing a student's respective `x` and `y` grades:```95 8585 9580 7070 6560 70```If you do not wish to read this information from stdin, you can hard-code it into your program.`Output Format`Print a single line denoting the answer, rounded to a scale of `3` decimal places (i.e., 1.234 format).<jupyter_code>X, Y = [], []
for i in range(5):
    x, y = map(int, input().split())
    X.append(x)
    Y.append(y)

n = len(X)

x_bar = sum(X) / n
y_bar = sum(Y) / n

s_xy = n * sum([x * y for x, y in zip(X, Y)]) - sum(X) * sum(Y)
s_xx = n * sum([x ** 2 for x in X]) - sum(X)**2

beta0 = y_bar - beta1 * x_bar
beta1 = s_xy / s_xx

print(f'{beta0 + beta1 * 80:.3f}')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12931034482758622, 'fraction_numerical': 0.04741379310344827, 'mean_word_length': 4.083941605839416, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '174578', 'license': 'MIT', 'n_tokens_mistral': 528, 'n_tokens_neox': 476, 'n_words': 205, 'path': '10 Days of Statistics/Day_8. Least Square Regression Line.ipynb', 'repo_name': 'Nam-SH/HackerRank', 'size': '1392'}