Interactive, runnable Python. Edit the code, run it in your browser, no setup required.
You will build a small Doppler calculator for sound. The idea. With speeds along the line, measured in the air, f' = f (v + v_o)/(v - v_s). Here v_o is positive when the listener moves towards the source, and v_s is p…
You will write a function that finds the molar solubility of any salt A_xB_y from its K_sp. Then you will sort some salts by how much of each dissolves, and decide whether a mixture gives a precipitate. The idea. K_sp…
Build tools for the two means, and use them to check the AM-GM inequality on many pairs. The idea. A = (a + b)/(2) and G = √(ab), with A ≥ G. n geometric means between a and b have ratio ((b)/(a))^(1)/(n + 1). Two num…
Each chromosome below is given by the lengths of its short arm and its long arm, in micrometres. You will name each one from where its centromere lies, count how many there are of each kind, and list the telocentric o…
You will simulate 4000 children of Pp with Pp and check that about one in four has white flowers. The idea. random.choice picks one letter from a parent. One letter from each parent, sorted, makes a child. A fixed see…
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 turn the readings of a resonance tube into the speed of sound. The idea. The first two resonances are half a wavelength apart, so v = 2f(l_2 - l_1). The end correction is e = (l_2 - 3l_1)/(2), and it is about…
You will write functions for the pH of an acidic buffer, before and after a little strong acid is added, and pick out the buffers that work best. The idea. pH = pK_a + [salt][acid]. In one solution you can use millimo…
Write the formulas of a geometric progression yourself, with exact fractions, and test them against plain adding. The idea. a_n = ar^n - 1, S_n = (a(r^n - 1))/(r - 1) for r 1 and na for r = 1, and S_∞ = (a)/(1 - r) fo…
Each plant part below is listed with what its plastids hold. You will write a function that names the plastid, name the plastid of every part, and list the parts whose plastids are leucoplasts. The idea. Chlorophyll:…
You will write the three pieces of a one-gene cross for flower colour in peas: purple (P) is dominant over white (p). The idea. A child takes one letter from each parent, sorted so the capital comes first. One P makes…
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 for beats. The idea. Two close frequencies give f_b = |f_1 - f_2| beats each second, and you hear the pitch (f_1 + f_2)/(2). An unknown fork is f_known + f_b or f_known - f_b. Wax lowers…
A weak acid has K_a = 6.3 × 10^-5. You will find its hydronium concentration by the shortcut and by the exact quadratic, the share that ionises, and the pH. The idea. The shortcut is √(K_a C). The exact value is the p…
You will write three small functions for arithmetic progressions: the nth term, the sum of n terms, and the means between two numbers. The checker tests them on many cases. The idea. a_n = a + (n - 1)d, S_n = (n)/(2)(…
Eight organelles of a eukaryotic cell are listed with their jobs. You will mark which belong to the endomembrane system, list the ones that do not, and put the stops of a secreted protein in order. The idea. A set is…
You will write two fitting functions: one that finds the doubling time of exponential counts with a straight line through N, and one that finds r and K of logistic counts with curve_fit. The idea. For exponential coun…
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 list the natural frequencies of a string and of two kinds of pipe, and count the notes below a limit. The idea. A string tied at both ends: f_n = (n)/(2L)√((T)/(μ)) for n = 1, 2, 3, A pipe open at both ends:…
You have one strong acid and one strong base. You will find the hydronium and hydroxide concentrations, then the pH and pOH of each. The idea. A strong acid gives all its H_3O^+, a strong base all its OH^-. Then K_w g…
You will make the terms of a sequence from its formula, build its partial sums with a loop, and then get the terms back from the sums. The checker tells you which tasks pass. The idea. A partial sum is the one before…
A red blood cell holds about 0.9 per cent salt. You will write a function that says which way water moves when a cell sits in a solution, then use it on four solutions. The idea. In osmosis, water moves towards the mo…
You will write the three small functions that grow a population in time steps: one exponential step, one logistic step, and a loop that runs the logistic steps for a given time. The idea. In a step of dt, an exponenti…
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 add two waves point by point, and check the result against the formula for the amplitude of the sum. The idea. A wave is y = a(kx - ω t + φ). Two waves of the same k and ω add to a wave of amplitude A = √(a_1…