Using your favorite programming language (Python, C, C++), implement a tool that has the following functions:
- Given a vector of numbers, verify whether it constitutes a valid probability distribution.
- Given a matrix of number, verify whether it constitutes a valid channel matrix.
- Print beautifully a prior on the screen.
- Print beautifully a channel matrix on the screen.
- Given a prior and a channel matrix, compute the corresponding joint probability distribution.
- Given a prior and a channel matrix, compute the corresponding hyper-distribution (i.e., the set of posterior distributions and the outer distribution on them).
- Given a prior distribution, compute its Shannon entropy.
- Given a prior distribution, compute its Guessing entropy.
- Given a prior distribution, compute its Bayes vulnerability.
- Given a prior distribution and a value n>=1, compute the probability of guessing correctly within n tries. (Note that when n = 1 this function coincides with Bayes vulnerability).
- Given a prior distribution and a gain function, compute the g-vulnerability. (Note that when the g-function is gid, you recover Bayes vulnerability).
- create functions that, given a prior and a channel matrix, compute the corresponding posterior information measures as in the items (a)-(e) of item (3) above.
- Given a prior, a channel matrix, and a information function, compute the corresponding additive leakage.
- Given a prior, a channel matrix, and a information function, compute the corresponding multiplicative leakage.