Thresholds for colourability and satisfiability in random graphs and boolean formulae