5Detecting and learning temporal regularities is essential to accurately predict the future. 6 Past research indicates that humans are sensitive to two types of sequential regularities: 7 deterministic rules, which afford sure predictions, and statistical biases, which govern the 8 probabilities of individual items and their transitions. How does the human brain arbitrate 9 between those two types? We used finger tracking to continuously monitor the online 10 build-up of evidence, confidence, false alarms and changes-of-mind during sequence 11 learning. All these aspects of behaviour conformed tightly to a hierarchical Bayesian 12 inference model with distinct hypothesis spaces for statistics and rules, yet linked by a 13 single probabilistic currency. Alternative models based either on a single statistical 14 mechanism or on two non-commensurable systems were rejected. Our results indicate 15 that a hierarchical Bayesian inference mechanism, capable of operating over several 16 distinct hypothesis spaces, underlies the human capability to learn both statistics and 17 rules.