We represent a process of learning by using bit strings, where 1 bits represent the knowledge acquired by individuals. Two ways of learning are considered: individual learning by trial and error, and social learning by copying knowledge from other individuals or from parents in the case of species with parental care. The age-structured bit string allows us to study how knowledge is accumulated during life and its influence over the genetic pool of a population after many generations. We use the Penna model to represent the genetic inheritance of each individual. In order to study how the accumulated knowledge influences the survival process, we include it to help individuals to avoid the various death situations. Modifications in the Verhulst factor do not show any special feature due to its random nature. However, by adding years to life as a function of the accumulated knowledge, we observe an improvement of the survival rates while the genetic fitness of the population becomes worse. In this latter case, knowledge becomes more important in the last years of life where individuals are threatened by diseases. Effects of offspring overprotection and differences between individual and social learning can also be observed. Sexual selection as a function of knowledge shows some effects when fidelity is imposed.