1require_relative "../physics"23question :errors_in_a_product do4 describes "%{error} of the product of %{first} ± %{first_error} and %{second} ± %{second_error}?"5 given :first6 given :first_error7 given :second8 given :second_error9 asks error: "How sure can we be"10end
1require_relative "../questions/errors_in_a_product"2require_relative "../science/units_and_measurement/uncertainty"34solve :errors_in_a_product, using: Uncertainty do5 take first: :a, first_error: :Delta_a, second: :b, second_error: :Delta_b6 find_value :p7 find_value :delta_p8 take error: :Delta_p9 find_value :error1011 conclusion "No surer than what went into it: the relative errors add, δp = δa + δb. So the " \12 "least precise of the measurements decides how precise the product can be."13end
1require_relative "../solutions/errors_in_a_product"23play_with :errors_in_a_product do4 title "Errors in a Product"56 input :a, 1.0..50.0, step: 0.1, default: 16.2, as: "first measurement"7 input :Delta_a, 0.0..2.0, step: 0.01, default: 0.1, as: "its error"8 input :b, 1.0..50.0, step: 0.1, default: 10.1, as: "second measurement"9 input :Delta_b, 0.0..2.0, step: 0.01, default: 0.1, as: "its error"1011 output :p12 output :delta_p, in: "%"13 output :Delta_p14end