Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Nounify

Function: nounify (<f>) Returns the noun form of the function name <f>. This is needed if one wishes to refer to the name of a verb function as if it were a noun. Note that some verb functions will return their noun forms if they cant be evaluated for certain arguments. This is also the form returned if a function call is preceded by a quote.

_entropy(x):=if (x=0) then 0 else x*log(x);
entropy(p,b):=-sum(_entropy(p[i])/log(b), i, 1, length(p));
entropy2(p):=entropy(p,2);
_total(x):=sum(x[i],i,1,length(x));
entropyArray(a):=entropy(map(lambda([x], x/_total(a)), a), _total(a));
/* traditional 2-based entropy */e:entropy([1/4,1/4,1/2,0], 2);
/* 1-based */e:entropy([1/4,1/4,1/2,0], 4);
/* over an array */ea:entropyArray([1,1,2,0]);
e=ea,pred;
nounify(log);
e;

(%o1)                                true
(%i2) 

Related Examples