Question: 1. Shannon entropy. Write a program ShannonEntropy. java that takes a command-line integer m; reads a sequence of integers between 1 and m from standard
1. Shannon entropy. Write a program ShannonEntropy. java that takes a command-line integer m; reads a sequence of integers between 1 and m from standard input; and prints the Shannon entropy to standard output, with 4 digits after the decimal point. The Shannon entropy of a sequence of integers is given by the formula: H=(mlog2pt+plog3pi++plog3p1) where pi denotes the proportion of integers whose value is i. If pi=0, then treat pilog2pi as 0 . Step-by-step calculation. Consider the following sequence of 16 integers generated from a loaded die. This table shows the frequencies xi, the proportions pi, and the pilog2pi terms: The Shannon entropy is 1.875=15/8. The Shannon entropy is a measure of the rate of information produced by a random source, such as the outcomes of flipping a fair coin or rolling a loaded die, It is a fundamental concept in information theory and data compression
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
