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 three functions that follow a reversible reaction A B in a closed container. One takes one small step in time. One runs many steps. One tests if the reaction is at equilibrium. The idea. In a small time…
Extended. You will build composite functions and inverse functions in Python. Your tasks. In compose, return a new function that applies inner first and then outer. In inverse, return the inverse function of f(x) = ax…
You will write three functions: the mutations that a model cell is expected to have, the effect of radiation, and the kinds of zygote from the kinds of gamete. The idea. In a model, each gene has a chance of changing…
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 three functions for crystals that hold water of crystallisation. One finds the relative formula mass of the crystals. One finds the percentage of water. One finds the mass of powder left after heating.…
You will find a root of x^3 - x - 3 = 0 by looking for a change of sign, and halving the gap again and again. Your tasks. In f, return x^3 - x - 3. In halve, start with low and high, where f(low) is negative and f(hig…
You will write functions that summarise a list of measurements: the mean, the range, and the number of values in a class. The idea. The mean is the total divided by the number of values. The range is the largest value…
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 three functions that turn the times of a cross experiment into rates and test a pattern. One finds a rate. One says how many times faster one run is than another. One tests if the rate is proportional t…
Extended. You will find the distance and the average speed from a speed-time graph given as a list of points. Your tasks. In distance, return the total area under the graph. For each pair of neighbouring points, add t…
You will write three functions: the kinds of gamete a parent can make, the kinds of zygote two parents can make, and the pairs needed for a given number of kinds. The idea. With n pairs of chromosomes, a parent makes…
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 three functions for a cube that is cut into smaller cubes. One counts the small cubes. One finds their total surface area. One finds how many times bigger the area has become. The idea. A cube with n pi…
Extended. You will test a table against proportion rules in Python and then use the rule that fits. Your tasks. In constants, return the list of y / x power for each pair, each rounded to 4 decimal places. Set power t…
You will write functions for the number of chromosomes in a gamete, in a zygote, and in a body cell after some generations when there is no halving. The idea. A gamete is haploid, so it has half of the diploid number.…
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…