Java API By Example, From Geeks To Geeks.

# Java > Open Source Codes > org > apache > commons > math > distribution > Distribution

 `1 /*2  * Copyright 2004 The Apache Software Foundation.3  *4  * Licensed under the Apache License, Version 2.0 (the "License");5  * you may not use this file except in compliance with the License.6  * You may obtain a copy of the License at7  *8  * http://www.apache.org/licenses/LICENSE-2.09  *10  * Unless required by applicable law or agreed to in writing, software11  * distributed under the License is distributed on an "AS IS" BASIS,12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13  * See the License for the specific language governing permissions and14  * limitations under the License.15  */16 package org.apache.commons.math.distribution;17 18 import org.apache.commons.math.MathException;19 20 /**21  * Base interface for probability distributions.22  *23  * @version \$Revision\$ \$Date: 2005-02-26 05:11:52 -0800 (Sat, 26 Feb 2005) \$24  */25 public interface Distribution {26     /**27      * For a random variable X whose values are distributed according28      * to this distribution, this method returns P(X ≤ x). In other words,29      * this method represents the (cumulative) distribution function, or30      * CDF, for this distribution.31      * 32      * @param x the value at which the distribution function is evaluated.33      * @return the probability that a random variable with this34      * distribution takes a value less than or equal to x35      * @throws MathException if the cumulative probability can not be36      * computed due to convergence or other numerical errors.37      */38     double cumulativeProbability(double x) throws MathException;39     40     /**41      * For a random variable X whose values are distributed according42      * to this distribution, this method returns P(x0 ≤ X ≤ x1).43      * 44      * @param x0 the (inclusive) lower bound45      * @param x1 the (inclusive) upper bound46      * @return the probability that a random variable with this distribution47      * will take a value between x0 and x1, 48      * including the endpoints49      * @throws MathException if the cumulative probability can not be50      * computed due to convergence or other numerical errors.51      * @throws IllegalArgumentException if x0 > x152      */53     double cumulativeProbability(double x0, double x1) throws MathException;54 }55 ` Popular Tags