implement trans probability calculator