<jupyter_start><jupyter_text>![](images/Teaching_computing.001.jpeg) This is an interactive notebook to illustrate ideas to make scientific computing more engaging.  Key points:   - Starting with a more complex idea can be more motivating- Live coding is a helpful tool to deliver programming content- Teach concepts as they are needed- Avoid too many baby steps       *Notebook cheats:*   To run the currently highlighted cell by holding &x21E7; Shift and press &x23ce; Enter;To advance the slide show use Space ![](images/Teaching_computing.002.jpeg)  Getting ready for the expedition to get to treasure      Then you finally reach treasure...![](images/treasure0.png)  The great dissapointment happens because....![](images/treasure1.png)  Exploring ideas for keeping students engaged  How1. Incentivise through glimpses at the treasures2. Using timely teaching environment3. Chose delivery methods wisely4. Use of formative assessment through in class exercises5. Give good motivations for new concepts!  What 1. Stay in the STEM context to help with motivation 2. Teach reproducibility and best practices as you go along ![](images/Teaching_computing.003.jpeg)  Which of the following instructions would be more motivating on day one? ![](images/Teaching_computing.005.jpeg)  What is a more appealing first lesson overview to a diverse set of students? ![](images/Teaching_computing.007.jpeg)<jupyter_code># reading data
data = pd.read_csv('data/gravity.csv',sep=' ')
# plotting data
sbn.distplot(data['Student1'], label = 'Student 1', norm_hist=True)
sbn.distplot(data['Student2'], label = 'Student 2', norm_hist=True)
plt.plot(np.ones(2)*9.81,[0,1.9], '--', color='black', alpha=0.5, label='Actual g')
sbn.despine()
# plot Formatting
plt.xlabel('Estimate of g')
plt.ylabel('Density')  
plt.legend()<jupyter_output><empty_output><jupyter_text>What approach is easier to follow for new complex concepts? ![](images/Teaching_computing.008.jpeg)  Live coding<jupyter_code># load the thrombin.csv file
data = np.loadtxt('data/thrombin.csv')
# plot time thrombin data
#Fixme

# compute correlation
r,p = scipy.stats.#Fixme
#print("The correlation is %.2f"%r)<jupyter_output><empty_output><jupyter_text>How can understanding amongst learners be assessed in a motivating way? ![](images/Teaching_computing.009.jpeg)  Check your understanding and use Tophat to indicate your answerQ. Suppose you have a dataset that consists of 4 columns in a variable called data, how do you plot the first and second column against each other? Try the different options in your notebook if you are unsure.1. `plt.plot(data[:,1], data[:,2])`2. `plt.plot(data[0,:], data[1,:])`3. `plt.plot(data[:,0], data[:,1])`4. `plot.plt(data[:,0], data[:,1])`⚠️ Use your red sticker if you get stuck, so that one of the tutors can help you.  Explore concepts without the necessity for any coding: Birge-Sponer in vibrational spectroscopyBirge-Sponer plot allow you to estimate an upper bound for discosiation energies from virbtational transitions. ![](images/dissociation.png)  Adding dataYou can add a set of vibrational transition wave numbers and their corresponding vibrational quantum numbers in the two cells below. An example for HgH would look like this:   Observed transitions in cm$^{-1}$: 1203.7, 965.6, 632.4, 172    Vibrational quantum numbers: 0.5, 1.5, 2.5, 3.5<jupyter_code>import Helper
data = Helper.data_input()
display(data)<jupyter_output><empty_output><jupyter_text>The data will be read by the program and then plotted against each other, when you execute the next cell.<jupyter_code>Helper.plot_birge_sponer(data)<jupyter_output><empty_output><jupyter_text>Extrapolating the dataNow in order to be able to compute the dissociation constant we need to extrapolate the line until it crosses the y-axis at x=0 and the x axis at y=0.   The plot below has done this automatically. The Helper module uses a linear regression fit called `linregress` as implemented in `scipy`.<jupyter_code>Helper.plot_extrapolated_birge_sponer(data)<jupyter_output><empty_output><jupyter_text>Computing the area under the curveYou can see, that the dashed orange line is the extrapolated curve to where the extrapolation is required. You could now try and read the numbers of the graph, or just compute the area under the curve, which in this case is a right-angle triangle. Remember the area of a triangle is given by:$A = \frac{1}{2}ab$,    where a, in this case, is the side of the y-axis and b is the side of the x-axis. Again there is a convenient helper function that will take the data from the curve and compute the area, and conveniently display this result.<jupyter_code>Helper.compute_area_under_graph(data)<jupyter_output><empty_output><jupyter_text>**Check your understanding**:How is the dissociation energy computed from the wave number that is estimated by the area under the curve?Try it yourself and see if you get the same answer as below.<jupyter_code>Helper.compute_dissociation_energy(data)<jupyter_output><empty_output><jupyter_text>⚠️ **Use your green sticker if you got to the same answer, or your red one if you got stuck!**  5 Approaches to help with motivation:1. Show treasures at the start!2. Hide complexity where necessary3. Motivate new concepts with appropriate STEM related examples4. Make use of the Ecosystem, such as interactive Jupyter notebooks5. Use frequent formative assessment and feedback Thank you for your attention!    I am happy to take any questions!  Data generation for some parts of the notebook<jupyter_code>g1 = np.random.normal(9.81,0.2, 50)
g2 = np.random.normal(9.2,0.6, 50)
g3 = np.random.normal(9.89, 0.2, 50)
np.savetxt('gravity.csv', np.column_stack((g1,g2,g3)))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08768558951965065, 'fraction_numerical': 0.02148471615720524, 'mean_word_length': 5.492063492063492, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '400152', 'license': 'CC0-1.0', 'n_tokens_mistral': 1774, 'n_tokens_neox': 1636, 'n_words': 689, 'path': 'Talk.ipynb', 'repo_name': 'meyresearch/Teaching_computing', 'size': '5725'}