// Path: combinatorics/src/test/java/com/xiantrimble/combinatorics/LeadingElementPerportionTest.java
// public static enum Element {
//   ONE,
//   TWO,
//   THREE
// }


import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.apache.commons.math.util.MathUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import static com.xiantrimble.combinatorics.LeadingElementPerportionTest.Element.*;
/**
 * Copyright (C) 2012 Christian Trimble (xiantrimble@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xiantrimble.combinatorics;






/**
 * This test verifies that for permutations of length k, containing two unique elements and k
 * total elements, the percentage of the time that any element is at any position is equal
 * to the percentage of the domain it represents.
 * 
 * This fact has implications for computing the size of a permutation, when you know
 * the size of some permutation near it.
 * 
 * Let kP be a permutation with a known k (kK), known multiplicity (kM[]), and known size (kS).
 * Let p be a permutation that varies from kP by type removal of some element from kM[i], with a known k (k=kK-1),
 * a known multiplicity (m[]), and an undetermined size (s).
 *
 * Then, this will be true:
 * s = ( kM[i] / total(kM) ) * kS
 * 
 * 
 * @author Christian Trimble
 *
 */
@RunWith(Parameterized.class)
public class LeadingElementPerportionTest {
// Path: combinatorics/src/test/java/com/xiantrimble/combinatorics/LeadingElementPerportionTest.java
// public static enum Element {
//   ONE,
//   TWO,
//   THREE
// }


// Path: combinatorics/src/test/java/com/xiantrimble/combinatorics/LeadingElementPerportionTest.java
import static org.junit.Assert.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.apache.commons.math.util.MathUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import static com.xiantrimble.combinatorics.LeadingElementPerportionTest.Element.*;

/**
 * Copyright (C) 2012 Christian Trimble (xiantrimble@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.xiantrimble.combinatorics;






/**
 * This test verifies that for permutations of length k, containing two unique elements and k
 * total elements, the percentage of the time that any element is at any position is equal
 * to the percentage of the domain it represents.
 * 
 * This fact has implications for computing the size of a permutation, when you know
 * the size of some permutation near it.
 * 
 * Let kP be a permutation with a known k (kK), known multiplicity (kM[]), and known size (kS).
 * Let p be a permutation that varies from kP by type removal of some element from kM[i], with a known k (k=kK-1),
 * a known multiplicity (m[]), and an undetermined size (s).
 *
 * Then, this will be true:
 * s = ( kM[i] / total(kM) ) * kS
 * 
 * 
 * @author Christian Trimble
 *
 */
@RunWith(Parameterized.class)
public class LeadingElementPerportionTest {
  public static enum Element {