<commit_before>//
//  MKProbability.swift
//  MathKit
//
//  Created by <NAME> on 5/25/15.
//  Copyright (c) 2015 DAZ. All rights reserved.
//

import Foundation

class MKProbability {
    var MathKitBasics = MKBasics()
    
    // Permutation Basic
    func permutation(totalObj: Int, objToHandle: Int) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator = MathKitBasics.factorial(totalObj - objToHandle)
        var final: Double = Double(numerator) / Double(denominator)
        return final
    }
    
    // PermutationRepitition
    func permutationWithRepitition(totalObj: Int, similarObjects: [Int]) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator = 1
        var iterator = 0
        while iterator < similarObjects.count {
            denominator *= MathKitBasics.factorial(similarObjects[iterator])
            iterator++
        }
        var final = Double(numerator) / Double(denominator)
        return final
        
    }
    
    // PermutationCircular
    func permutationCircular(totalObj: Int) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator = totalObj
        var final = Double(numerator) / Double(denominator)
        return final
    }
    
    
    // Combination Basic
    func combination(totalObj: Int, objToHandle: Int) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator = ((MathKitBasics.factorial(totalObj - objToHandle)) * (MathKitBasics.factorial(objToHandle)))
        var final: Double = Double(numerator) / Double(denominator)
        return final
    }
    
    // Odds For
    func oddsFor(probSuccess: Double, probFailure: Double) -> Double {
        return probSuccess / probFailure
    }
    
    // Odds Against
    func oddsAgainst(probSuccess: Double, probFailure: Double) -> Double {
        return probFailure / probSuccess
    }
    
    
    
}<commit_msg>Probability functions now work for decimals<commit_after>//
//  MKProbability.swift
//  MathKit
//
//  Created by <NAME> on 5/25/15.
//  Copyright (c) 2015 DAZ. All rights reserved.
//

import Foundation

class MKProbability {
    var MathKitBasics = MKBasics()
    
    // Permutation Basic
    func permutation(totalObj: Double, objToHandle: Double) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator = MathKitBasics.factorial(totalObj - objToHandle)
        var final: Double = Double(numerator) / Double(denominator)
        return final
    }
    
    // PermutationRepitition
    func permutationWithRepitition(totalObj: Double, similarObjects: [Double]) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator: Double = 1
        var iterator = 0
        while iterator < similarObjects.count {
            denominator *= MathKitBasics.factorial(similarObjects[iterator])
            iterator++
        }
        var final = Double(numerator) / Double(denominator)
        return final
        
    }
    
    // PermutationCircular
    func permutationCircular(totalObj: Double) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator = totalObj
        var final = Double(numerator) / Double(denominator)
        return final
    }
    
    
    // Combination Basic
    func combination(totalObj: Double, objToHandle: Double) -> Double {
        var numerator = MathKitBasics.factorial(totalObj)
        var denominator = ((MathKitBasics.factorial(totalObj - objToHandle)) * (MathKitBasics.factorial(objToHandle)))
        var final: Double = Double(numerator) / Double(denominator)
        return final
    }
    
    // Odds For
    func oddsFor(probSuccess: Double, probFailure: Double) -> Double {
        return probSuccess / probFailure
    }
    
    // Odds Against
    func oddsAgainst(probSuccess: Double, probFailure: Double) -> Double {
        return probFailure / probSuccess
    }
    
    
    
}
{'fraction_non_alphanumeric': 0.08873974645786727, 'fraction_numerical': 0.005468555804126274, 'mean_word_length': 2.448157669237361, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '723591', 'n_tokens_mistral': 1188, 'n_tokens_neox': 1122, 'n_words': 274}