Question: Define a function MetricEntropy ( w , alphabetSize ) that computes the metric entropy of w if it is assumed that the alphabet has size

Define a function MetricEntropy (w, alphabetSize) that computes the metric entropy of w if it is assumed that the alphabet has size alphabetSize (that is |A|= alphabetSize). You must code this function for yourself and cannot use a built-in "Entropy" function.
Use MatLab
Definition 2.1 For A={a1,a2,dots,an} and Pai the probability of occurrence in winA** of ai, then metric entropy of w is given by
H(w)=-i=1nPailog(Pai)
For example, if w= AAAACCCGGT, then |w|=10,PA=410,PC=
310,PG=210, and PT=110. So then
H(w)=-(410log(410)+310log(310)+210log(210)+110log(110))=1.27985
 Define a function MetricEntropy (w, alphabetSize) that computes the metric entropy

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!