Understanding the question is the only tough part here , else is too easy.
Now, coming to f(s) , it says :$f(s)= \Pi^n_{i=1}P_i^{g(a_i)}$ .
Lets say we have a string as = “bac”
then $f(bac)$ = $P_1^{g(a_1)}*P_2^{g(a_2)}*P_3^{g(a_3)}$
here, $a_1 = b , a_2 = a , a_3 = c $
Putting these into $f(bac)$ definition :
$f(bac)$ = $P_1^{g(b)}*P_2^{g(a)}*P_3^{g(c)}$
And also given that $P_i = $ i th prime number. So $P_1 = 2 , P_2 = 3, P_3 = 5$. Therefore :
$f(bac)$ = $2^{g(b)}*3^{g(a)}*5^{g(c)}$
Now putting the mapping that is given into the question :
$f(bac)$ = $2^{5}*3^{3}*5^{7}$
$f(bac) = 6,75,00,000$
Let this sequence of $”bac"$ be our $s_1$
Similarly lets have one more sequence $s_2 : “cab”$
$f(s_2) = 1,08,00,000$
Therefore , we have two string $s_1, s_2$
Now , there’s another function $h(<s_i..s_j>)$ which does the encoding of the sequence of string in the same way we did string encoding:
$h(<s_1,s_2>) = \Pi^2_{i=1}P_i^{f(s_i)}$ , which is equivalent to :
$h(<s_1,s_2>) = P_1^{f(s_1)}*P_2^{f(s_2)}$
$h(<s_1,s_2>) = 2^{f(s_1)}*3^{f(s_2)}$
$h(<s_1,s_2>) = 2^{6,75,00,000}*3^{1,08,00,000}$
$h(<bac,cab>) = 2^{6,75,00,000}*3^{1,08,00,000}$
As you can see , the encoding is so big , from this we can kinda conclude by seeing the options that string must be of single alphabet and there are 3 strings as every option has 3 prime numbers.So given sequence has three strings of single alphabet .
Now we can also see that every string starts with prime number $2$ $=>$ $(2^{something} * 3^{something} * 5^{something}...)$ , so $2$ must be a multiple , therefore by seeing this only we can remove options ‘a’ and ‘c’
Now option ‘d’ , also can be removed as we cannot get 10 anyhow in:
$2^{something} * 3^{something} * 5^{something}$
We’re left with option ‘b’ only which has $8$ in it. Now we can get $8$ by $2^3$ and also $g(a) = 3$
So our sequence must be : $“a” , “a” , “a”$