1. Z test

Null Hypothesis:
The ratio of older people (>=40) biking at night over all older people biking during a day is the same or higher than the ratio of younger people (< 40) biking at night to all the younger people biking during a day.
\(H_0:\ \frac{Y_{night}}{Y_{total}}\le\frac{O_{night}}{O_{total}}\)
\(H_a:\frac{Y_{night}}{Y_{total}}>\frac{O_{night}}{O_{total}}\)
The Z statistics is:
\(z=\frac{(p_0-p_1)}{SE}\)
\(p=\frac{p_0n_0+p_1n_1}{n_0+n_1}\)
\(SE=\sqrt{p(1-p)(\frac{1}{n_0}+\frac{1}{n_1})}\)

2.  Chi-square test

 Null Hypothesis:
The ratio of older people (>=40) biking at night over all older people biking during a day is the same as the ratio of younger people (< 40) biking at night to all the younger people biking during a day.
 \(H_0:\ \frac{Y_{night}}{Y_{total}}=\frac{O_{night}}{O_{total}}\)
\(H_a:\ \frac{Y_{night}}{Y_{total}}\ne\frac{O_{night}}{O_{total}}\)
The chi-square statistics is:
\(\chi^2=\sum_i^{ }\frac{(observation_i-\exp ectation_i)^2}{\exp ectation_i}\)
The contingency table is listed below.