F
freiheit07
Gast
Hallo alle zusammen,
folgendes dilemma liegt an.
Ich will anhand eines kleines Java Programmes den Informationsgehalt eines Strings berechnen.
Die Formel für den Informationsgehalt ist
l(xi) = log2 (1 / p(xi)
Ich habe bisher folgendes Programmiert.
folgendes dilemma liegt an.
Ich will anhand eines kleines Java Programmes den Informationsgehalt eines Strings berechnen.
Die Formel für den Informationsgehalt ist
l(xi) = log2 (1 / p(xi)
Ich habe bisher folgendes Programmiert.
Code:
/**
* Write a description of class Informationsgehalt here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Informationsgehalt
{
private String text;
/**
* Konstruktor um einen Text zu erzeugen
*/
public Informationsgehalt()
{
text = "Hallo Welt";
}
public void berechneInformationsgehalt()
{
// Hier kommt meine Formel hinein
}
public void informationsgehaltAusgeben()
{
}
}
Kann mir jemand helfen, wie ich die Formel umwandeln kann?
Ich danke im Voraus.