How to calculate the number of combinations of text in Russian with a length of 1000 characters?

There are 400,000 words in Russian. The average word length in Russian is 5.28 characters. The semantic content of the text does not matter, we are only interested in the maximum number of combinations.

How to estimate the number of possible texts with a length of 1000 characters?

Author: Harry, 2016-04-27

1 answers

A simple solution in C: fill the text with words and multiply by the number of options, that is, words in the alphabet. The result is a giant number that doesn't fit anywhere, so I only store the degree: 400000 ^ 190. If you add spaces between words, but the degree is 30 less.

#include <stdio.h>

const int wordsCount = 400000;
const double wordLength = 5.28;
const int textLength = 1000;

int main () {
    // количество символов в тексте
    double symbolCount = 0;
    // степень количества вариантов
    unsigned int power = 1;
    // заполнение текста словами
    while (symbolCount < textLength) {
        symbolCount += wordLength;// + 1 для пробелов
        power++;
    }
    // цикл заполняет текст больше лимита, можно вычесть одно словечко
    power--;
    // собственно, вывод результатов
    printf("%d ^ %u\n", wordsCount, power);
    return 0;
}

And the Python counted and so:

wordsCount = 400000
wordLength = 5.28
textLength = 1000

count = 1
symbols = 0

while (symbols < textLength):
    count *= wordsCount
    symbols += wordLength + 1

count

But the result does not inspire confidence, it does not have enough zeros at all:

 0
Author: AivanF., 2016-04-27 21:25:01