Did the new checkout button win?
A fashion retailer in Milan tested a redesigned checkout button. Group A saw the old button, group B saw the new one. The product manager wants the conversion rates, the relative uplift and a two-proportion z statistic to decide whether the difference is more than noise.
Task: line 1 is visitors_A conversions_A and line 2 is visitors_B conversions_B (integers; conversions_A is at least 1 and the pooled rate is below 1). Let pA = convA / visA, pB = convB / visB, pooled rate p = (convA + convB) / (visA + visB), and z = (pB - pA) / sqrt(p * (1 - p) * (1 / visA + 1 / visB)). Print two lines. Line 1: A=x.xx% B=y.yy% uplift=+u.uu% z=z.zzz, where the rates are percentages with 2 decimals, uplift is (pB - pA) / pA * 100 printed with an explicit sign and 2 decimals (like +20.00% or -5.50%), and z has 3 decimals. Line 2: Significant: yes if |z| >= 1.96, otherwise Significant: no.
Sample tests
Input
10000 400 10000 480
Expected output
A=4.00% B=4.80% uplift=+20.00% z=2.758 Significant: yes
Input
5000 250 5200 230
Expected output
A=5.00% B=4.42% uplift=-11.54% z=-1.375 Significant: no
Your answer is also checked against 3 hidden tests.
Log in or create a free account to run your code, submit and earn points.
Run your code to see the output here. Ctrl + Enter also runs it.
