Good day, dear community. I have a question for you that is not related to programming, but perhaps some of you have already encountered a similar problem. I am writing a program for decrypting a simple replacement cipher using frequency analysis. I decided to decipher the frequencies of the digrams. But instead of using ready-made frequency statistics, I would like to collect my own. That is, I will enter texts in Russian, the program will count the frequency of digrams in them and update the statistics table in the file. Here is the question itself: how can I update the statistics? The first thought was to take the arithmetic mean of the frequency of the digram from the file and from the text, and record it in the statistics. But this is clearly not the case.
PS Forgive me, that the question is off topic, just nowhere else to look.