- \n",
"
- To help you learn some Python essentials and programming skills to enjoy the remainder of this course.\n", "

- \n",
"
- Complete the notebook below, as follows. Click on a question, then from the menu select Insert -> Insert Cell Below. From the dropdown box (next to the \"stop\" symbol) choose whether you wish to insert 'Code' or 'Markdown'. Save regularly! \n", " \n", "
- Press Shift-Enter to execute the code in a cell.\n", "\n", "
- Submit the .ipynb file via http://somas-uploads.shef.ac.uk/mas212 by 23.59pm on Sun 7th Oct 2018.
*If you are off-campus, you will need to use a VPN to submit.*\n", "\n", " - Your lecturer will mark each question as either 2 (good), 1 (needs revision), 0 (not attempted/wrong).\n", "\n", "
- This is an open-book test, which means you may consult books, notes and internet resources.
**Do not discuss or share your test with anyone**. Copy-and-pasting is**not permitted**.*Please give answers in your own words.*\n", " \n", " - Some of these questions are relatively straightforward, and some are harder (e.g. Q10, 11, 13, 19, 20). Please don't spend any longer than a maximum of 3 hours on this test, as it is for a relatively small amount of credit.\n", "

- \n",
"
- Lecture materials and links on course web page: http://sam-dolan.staff.shef.ac.uk/mas212/\n", "

\n", "

`list`

and `set`

containers, highlighting at least one similarity and one difference between them.`ufunc`

?`A`

, `B`

and `C`

be arrays with shapes `(3,3,4)`

, `(1,4)`

and `(4,4)`

, respectively. Which of the following products exist, under the rules of broadcasting?(i)

`A\\*A`

; (ii) `A\\*B`

; (iii) `A\\*C`

."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n", "

`print()`

your result to 12 decimal places.\n",
"`\"me.txt\"`

.`pascal(n)`

to calculate the `n`

-th row of Pascal's triangle as a list. For example, `pascal(3)`

should return the list `[1,3,3,1]`

.`print()`

the `20`

th row.\n", "

`checkpalindrome(s)`

which returns True if the phrase in `s`

is a palindrome, and False otherwise. Check your function works by using the string above.\n", "

`numpy`

and linear algebra`xs`

(above) by using the formula $$\\langle x\\rangle> = \\frac{1}{n} \\sum_i x_i$$`xs`

by using the formula\n",
"$$\\text{var} = \\langle x^2 \\rangle - \\langle x \\rangle^2$$`xs.mean()`

or `xs.var()`

in Q14 and Q15]."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n", "Make a conjecture about the entries in $A^n$.

\n", "

The ciphertext is:

`PBVZFVOOWCFSQHWL`

.(

`chr()`

and `ord()`

useful.)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 1
}