Interactive, runnable Python. Edit the code, run it in your browser, no setup required.
You will write three functions for the measuring circuits of this course. The idea. A meter bridge balances when (X)/(R) = (l)/(100 - l). A potentiometer compares emfs by their balance lengths. A cell with a resistor…
You will write functions that predict whether a metal dissolves in a solution of another metal's ions. You will also pick out the metals that release hydrogen from acid, and work out the free energy change of a reacti…
Two ideas of this lesson are easy to test in code: the sum of r ^nC_r, and the coefficient of x^k in (1 + x)^α for an index α that is not a whole number. A falling product replaces the factorial. Your tasks. In weight…
A family runs a small farm with cattle, poultry, fish and bees. You will find the profit of each part. Then you will find the part that earns the most and the profit of the whole farm. The idea. For each part of the f…
You will fit a sine to 60 noisy readings of a swinging spring, with a first guess from the FFT. The idea. The FFT finds the main frequency to within one bar. curve_fit then refines the amplitude, the frequency and the…
You will build a function that summarises any list of numbers: how many, the mean, the median, the range and a chance. Then it summarises the month, and the definition of a hot day is yours to choose. The idea. A summ…
You will write three functions that describe a group of cells, and then find the best arrangement. The idea. N identical cells are joined in m rows of k cells, with N = mk. The group has emf kE and internal resistance…
You will write functions that work with a table of standard potentials. One finds the cell potential of two half-cells. One says whether a cell works. You will also find the best pair of electrodes in the table. The i…
The ratio rule is quick, but a computer can check it against every term. In this lab you find the greatest terms of (a + b)^n by trying every term, then by the rule, and then you test for a tie. Your tasks. In by_tryi…
A dairy keeps four cows. You will write a function for the milk in one lactation. Then you will find the milk of each cow and the cow that gives the most. Last, you will work out the income from the whole herd. The id…
You will draw a wave of wavelength 3.0 m and frequency 4.0 Hz at two times, find its first crest each time, and work out its speed. The idea. The crest of y = A(kx - ω t) moves at the speed v = fλ. You find where the…
The month of 30 days is in two lists: the temperatures and the rainy days. You will split the temperatures into rainy and dry days, and count how many days had each temperature. Then the program draws a line graph wit…
You will write three functions that a designer of resistors might use. The idea. A round wire has R = ρ L/A with A = π d^2/4. A metal has R = R_0[1 + α(T - T_0)]. A carbon resistor shows two digits, a power of ten and…
A flask holds iron(II) solution. You will turn the titre of permanganate into moles, then into the concentration of iron(II), and check the answer with equivalents. The idea. Moles are concentration times volume in li…
Write tools that expand a power term by term, find a remainder from two terms, and add the first terms of (1 + h)^n. The idea. The terms of (a + b)^n are ^nC_k a^n - k b^k. Modulo d^2, (d + 1)^n behaves like 1 + nd. F…
A store holds 100 tonnes of grain. An untreated store loses 8\% of the grain that is left each month. A store that is cleaned, dried and fumigated loses 1\% each month. You will follow the untreated store for six mont…
You will write three small functions that check a claimed identity on many angles: one finds the worst miss between the two sides, one says whether the identity holds, and one finds an angle where it fails. The idea.…
You will find the exact probability of each sum of two dice by listing the 36 pairs, then roll two dice 3,600 times and compare. The program draws both side by side. The idea. The exact probability counts equally like…
You will write three small functions about the current in a copper wire. They use I = nAev_d. The idea. One electron has a charge of 1.6 × 10^-19 C. Copper has 8.5 × 10^28 free electrons in each cubic metre. Areas are…
Chlorate ions oxidise iron(II) ions in acid. You will use the electrons gained and lost to find how many ions react, and then the number of H^+ ions the equation needs. The idea. One chlorine atom goes from +5 in chlo…
Build rows of Pascal's triangle in two different ways, and use them to check the sums of the coefficients. The idea. Each coefficient is the one before it times (n - r + 1)/(r). The next row comes from adding neighbou…
Farmers in India sow kharif crops with the rains and rabi crops in winter. A list gives the season of each crop. You will sort the crops by season and find the share of kharif crops. The idea. Go through the crops, an…
You will write three small functions for angles: one that converts degrees to radians without math.radians, one that finds the quadrant of an angle, and one that returns the point of the unit circle at an angle. The i…
You will toss a coin 500 times in a program, keep the share of heads after every toss, and draw how that share moves. Then you see how close the last share comes to 0.5. The idea. The share of heads jumps about in a s…
You will find the energy levels and the spectral lines of any atom or ion that has one electron. The idea. The level n has energy E_n = -(13.6 Z^2)/(n^2) eV. A jump gives a photon with the difference of two levels, an…