Abstract We develop a model of the process of thinking in the presence of noise (which is produced by the simultaneous action of a huge number of neurons in the brain as well as by external information and internal cognitive processes). Our model is based on Freud's idea on the splitting of cognitive processes into two (closely connected) domains: consciousness and subconsciousness. We represent the process of thinking as a random dynamical process in a space of ideas endowed with a non-Euclidean geometry (which differs extremely from the ordinary Euclidean geometry of spatial location of neurons in the brain). The so-called p-adic geometry on a space of ideas describes the ability of cognitive systems to form associations. We show that random dynamical thinking systems on a p-adic space of ideas still generate only deterministic ideas. We also study positive and negative effects of noise (in particular, creativeness and stress).