Federated Learning(FL) is a branch of machine learning which is developed for better data and privacy security. In FL, let's consider a very simple and interesting case.
Assume we build a FL system in a tree structure, there are
Starting from the client which has received the global model, it will update itself to the global model and send the global model to its adjacent client to update. Each not updated client has a probability of
Now the problem is that, if exactly one client will get the global model initially, can you calculate the probability that exactly
The first line contains two integers
The following
Then following
It is guaranteed that
One line an integer. The integer should be the answer modulo
5 3
3 1
3 2
1 5
1 4
4 2 7
5 1 9
3 2 3
8 1 7
11 6 11
666077058
For 100% testcases,
If you don't know how to print the answer, here are some hints.
In Discrete Math, we know that how to solve congruence
Also in Discrete Math, you have learnt Fermat's little theorem or extended Euclidean algorithm.