Interactive, runnable Python. Edit the code, run it in your browser, no setup required.
You will build logic gates from one gate, the NAND gate, as a factory would. The idea. A NAND gate gives 0 only when both inputs are 1. NOT is a NAND gate with its two inputs tied. AND is a NAND gate followed by a NOT…
You will write a small program that finds the lone pairs, the steric number and the shape of an interhalogen or xenon compound. The idea. The central atom has some outer electrons. Each bonded atom uses one of them. T…
You will write four functions that judge a straight-line fit: the residuals, the sum of the squared residuals, the coefficient of determination and a test for a point that changes r a lot. The helper fit is already wr…
A dictionary holds the readings of the wells of an ELISA plate. You will decide which samples are positive and work out the share that is positive. The idea. A sample is positive when its reading is above the cutoff.…
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 four functions that a designer uses for a transistor in the common-emitter circuit. The idea. β = (α)/(1 - α). In a circuit with one supply, I_B = V_CC - 0.7R_B, I_C = β I_B and V_CE = V_CC - I_C R_C, a…
You will finish a program that predicts which halogens oxidise which halide ions. It works from the standard electrode potentials. The idea. A halogen oxidises the halide of another halogen if its potential is higher.…
You will write four functions: the correlation coefficient, the slope and the intercept of the line of y on x, and a prediction. The checker tests them on data with known answers, and on data that lie exactly on a lin…
You will write the model of the antibody level in the blood after a first and a second exposure, and use it to find the day of each peak. The idea. The first response is (d)/(12) e^1 - d/12 on day d, with a peak of 1…
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 four functions that describe a Zener regulator and its limits. The idea. The series resistor carries I_s = V_in - V_zR_s. The load takes (V_z)/(R_L) and the Zener diode takes the rest. The limits on R_s…
You will write functions that find the oxidation state of sulphur in an oxoacid, tell whether the acid has an O-O peroxide link, and list the acids that have a given state. The idea. Oxygen is -2, except in an O-O lin…
You will write four functions that find the quartiles, the interquartile range, the outliers and the ends of the whiskers of a box plot. The helper median_of is already written. The checker uses data with an even and…
You will list the days of fever of a patient with malaria. Then you count the infected red cells in a simple model. Last, you find how many cycles are needed to reach a given number of cells. The idea. In the model, e…
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 four functions that a power-supply designer uses for a rectifier and its smoothing capacitor. The idea. For an ideal half-wave rectifier the mean output is V_m/π. For a full-wave rectifier it is 2V_m/π.…
You will write three functions for the reaction 2KClO_3 → 2KCl + 3O_2. The first finds the volume of oxygen from a mass of the salt. The second finds the mass of the salt that is needed for a volume. The third finds t…
You will write four functions: the coefficient of variation, the new mean and spread after every value is changed, and the combined mean and standard deviation of two groups. The checker tests them on data with known…
A dictionary holds the kind of pathogen and the way of spreading for ten diseases. You will look up a disease, list the diseases of one route, and count the diseases of each kind. The idea. A dictionary maps a name to…
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 write four functions that describe a silicon diode, from the diode equation to a diode in series with a resistor. The idea. The diode equation is I = I_s(e^V/V_T - 1), with V_T = (kT)/(e). In a circuit, a con…