You will write the functions that a polymer laboratory uses to report the molar mass of a sample. A sample is a list of fractions, and each fraction is a pair (moles, molar_mass).
The idea. The number average weights each molar mass by its moles. The weight average weights it by its mass. Their ratio is the polydispersity index.
Your tasks.
number_average(sample): total mass over total moles.weight_average(sample): the sum of moles times molar mass squared, over the total mass.carothers(p): the number average chain length .Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…