Question - What is the difference between Context free languages and regular languages?
Answer -
Regular languages can be represented by FA’s because we do not need any memory to recognize (accept or reject them on FA) them but there is another class of languages that can not be represented by FA’s because these languages require that we have some memory (with the help of memory we can store letters of the string we are checking so that we can compare them with next coming letters in the string).
For example language anbn requires that we must store a’s and then compare their count with next coming b’s so that we can check whether a’s are equal to b’s or not.
Due to this reason we use Context Free Grammars to represent them because we can5t write RE’s for them.
So Context Free Languages represent a broader category this category also include regular languages as subcategory. It means that context free languages include regular languages as well as some other languages.