001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.commons.math.distribution;
018
019 /**
020 * The Pascal distribution. The Pascal distribution is a special case of the
021 * Negative Binomial distribution where the number of successes parameter is an
022 * integer.
023 *
024 * There are various ways to express the probability mass and distribution
025 * functions for the Pascal distribution. The convention employed by the
026 * library is to express these functions in terms of the number of failures in
027 * a Bernoulli experiment [2].
028 *
029 * <p>
030 * References:
031 * <ol>
032 * <li><a href="http://mathworld.wolfram.com/NegativeBinomialDistribution.html">
033 * Negative Binomial Distribution</a></li>
034 * <oi><a href="http://en.wikipedia.org/wiki/Negative_binomial_distribution#Waiting_time_in_a_Bernoulli_process">Waiting Time in a Bernoulli Process</a></li>
035 * </ul>
036 * </p>
037 *
038 * @version $Revision: 920852 $ $Date: 2010-03-09 07:53:44 -0500 (Tue, 09 Mar 2010) $
039 * @since 1.2
040 */
041 public interface PascalDistribution extends IntegerDistribution {
042 /**
043 * Access the number of successes for this distribution.
044 *
045 * @return the number of successes
046 */
047 int getNumberOfSuccesses();
048
049 /**
050 * Access the probability of success for this distribution.
051 *
052 * @return the probability of success
053 */
054 double getProbabilityOfSuccess();
055
056 /**
057 * Change the number of successes for this distribution.
058 *
059 * @param successes the new number of successes
060 * @deprecated as of v2.1
061 */
062 @Deprecated
063 void setNumberOfSuccesses(int successes);
064
065 /**
066 * Change the probability of success for this distribution.
067 *
068 * @param p the new probability of success
069 * @deprecated as of v2.1
070 */
071 @Deprecated
072 void setProbabilityOfSuccess(double p);
073 }