Logical basis for information theory and probability theory