function e = get_entropy(p,k,w)
    if(nargin < 3)
        w = ones(1,length(p));
    end
    
    e = 0;
    if(nargin < 2)
        k = 1;
    end
    
    for i=1:1:length(p)
        if(p(i) == 0)
            continue;
        end
        e = e + (w(i)*(-1)*p(i)*log(p(i)));
    end
    
    e = e*k;
    
end