Interactive, runnable Python. Edit the code, run it in your browser, no setup required.
You will write three small functions about electromagnetic waves and digital signals. The idea. For every electromagnetic wave, c = fλ with c = 3.0 × 10^8 m/s. The regions of the spectrum have approximate limits in fr…
You will write four functions for the lesson on condensation polymers. One counts the links in a chain. One finds the relative mass of a chain from its monomers. One finds the relative mass of a repeat unit. One finds…
You will solve x = k, x = k and x = k for 0^° ≤ x ≤ 360^° with a list of candidate angles. The function keep is given: it keeps the angles in range, rounds them to 1 decimal place, removes repeats and sorts them. Your…
You will write functions for the numbers in making a human protein in bacteria, and a lookup for the order of the steps. The idea. Some bacteria take up a plasmid, and some of those plasmids carry the human gene. The…
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 write a shuffling test for two groups and use it on made-up data. The idea. Under the null idea of no difference, the labels mean nothing. Pool the values, shuffle, split them again and record the difference…
You will write three small functions about electric charge. The idea. Like charges repel and unlike charges attract. When a rod is rubbed with a cloth, electrons move from one to the other, and the total charge stays…
You will write four functions for the lesson on addition polymers. One finds the relative formula mass of a repeat unit from the four groups on its two carbon atoms. One finds the mass of a chain. One finds the number…
You will write the position, the speed and the meeting time of two particles as functions. Your tasks. In position, return the position (x, y) of a particle after time t, from its start and its velocity. In speed, ret…
You will write functions for a culture of bacteria and for the fermentation of glucose by yeast. The idea. Each division doubles the bacteria, so after n divisions one bacterium gives 2^n. In a reaction the total mass…
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…
You will test a coin both ways: by simulation and by exact counting. The idea. Under the null idea, the coin is fair. The p-value is the chance that a fair coin gives at least as many heads as the real one. Your tasks…
You will write three small functions about a flat lamina and about toppling. The idea. A uniform lamina is made of rectangles. The weight of each rectangle is in proportion to its area, and acts at its middle. A recta…
You will write four functions for the lesson on climate. One finds the glucose that a plant makes from a mass of carbon dioxide. One finds the volume of oxygen it gives out. One finds the carbon dioxide from burning p…
You will count arrangements and numbers by listing all of them with a condition, and compare with the rules of the lesson. Your tasks. Set together to the number of ways to seat the six people "ABCDEF" in a row so tha…
You will write functions for a population whose births fall as it approaches the level that its food can support. The idea. In each step, births are b × n × (1 - n/K) for n animals and a food limit K. Deaths are d × n…
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 simulate many surveys from a town where the true share is known, and count how often the 95% interval catches it. The idea. Each survey asks n people. Each person says yes when a random number is below the tr…
You will write three small functions that apply the principle of moments. The idea. The moment of a force is the force times its distance from the pivot. A beam balances when the total moment on the left equals the to…
You will write four functions for the first two lessons. One finds the carbon dioxide from the complete combustion of methane. One finds the carbon monoxide if all of the methane burns incompletely. One finds the calc…
You will write the factorial, permutation and combination counts as functions, and check them against a list. Your tasks. In factorial, return n! with a loop. Remember that 0! = 1. In permutations_count, return ^nP_r…
You will write functions that read a list of counts of cells made at equal times. The idea. The change between two readings is the later count minus the earlier count. The phase follows the sign and size of the change…
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 write the 95% interval for a proportion, with a check of its conditions. The idea. The estimate is p = countn. The margin is 1.96√(( p(1 - p))/(n)). The formula is trusted only with at least 10 successes and…
You will write three small functions about scalar and vector quantities. The idea. A scalar has size only. A vector has size and direction. Two vectors at right angles have a resultant given by Pythagoras, and its dir…