1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 package org.apache.commons.math.distribution;
18
19 /**
20 * The Pascal distribution. The Pascal distribution is a special case of the
21 * Negative Binomial distribution where the number of successes parameter is an
22 * integer.
23 *
24 * There are various ways to express the probability mass and distribution
25 * functions for the Pascal distribution. The convention employed by the
26 * library is to express these functions in terms of the number of failures in
27 * a Bernoulli experiment [2].
28 *
29 * <p>
30 * References:
31 * <ol>
32 * <li><a href="http://mathworld.wolfram.com/NegativeBinomialDistribution.html">
33 * Negative Binomial Distribution</a></li>
34 * <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>
35 * </ul>
36 * </p>
37 *
38 * @version $Revision: 613570 $ $Date: 2008-01-20 08:03:24 -0700 (Sun, 20 Jan 2008) $
39 * @since 1.2
40 */
41 public interface PascalDistribution extends IntegerDistribution {
42 /**
43 * Access the number of successes for this distribution.
44 *
45 * @return the number of successes
46 */
47 int getNumberOfSuccesses();
48
49 /**
50 * Access the probability of success for this distribution.
51 *
52 * @return the probability of success
53 */
54 double getProbabilityOfSuccess();
55
56 /**
57 * Change the number of successes for this distribution.
58 *
59 * @param successes the new number of successes
60 */
61 void setNumberOfSuccesses(int successes);
62
63 /**
64 * Change the probability of success for this distribution.
65 *
66 * @param p the new probability of success
67 */
68 void setProbabilityOfSuccess(double p);
69 }