/**
 * As a biologist, you have collected data in the form of tuples. However, due to floating-point errors, 
 * direct comparison of tuples may give unexpected results. Your task is to implement a function that 
 * accurately compares two tuples while accounting for floating-point errors by considering a small epsilon value.
 *
 * Hint: You can use the Math.abs() function to get the absolute value of a number and compare it with the epsilon value.
 *
 * @param t1 The first tuple to compare.
 * @param t2 The second tuple to compare.
 * @return True if the tuples are considered equal, False otherwise.
 */
fun compareTuples(t1: DoubleArray, t2: DoubleArray): Boolean {

    val epsilon = 1e-9  // Small epsilon value for floating-point comparison

    if (t1.size != t2.size) {
        return false
    }

    for (i in t1.indices) {
        val diff = Math.abs(t1[i] - t2[i])
        if (diff > epsilon) {
            return false
        }
    }

    return true
}
/**
 * As a biologist, you have collected data in the form of tuples. However, due to floating-point errors, 
 * direct comparison of tuples may give unexpected results. Your task is to implement a function that 
 * accurately compares two tuples while accounting for floating-point errors by considering a small epsilon value.
 *
 * Hint: You can use the Math.abs() function to get the absolute value of a number and compare it with the epsilon value.
 *
 * @param t1 The first tuple to compare.
 * @param t2 The second tuple to compare.
 * @return True if the tuples are considered equal, False otherwise.
 */
fun compareTuples(t1: DoubleArray, t2: DoubleArray): Boolean {
/**
 * As a biologist, you have collected data in the form of tuples. However, due to floating-point errors, 
 * direct comparison of tuples may give unexpected results. Your task is to implement a function that 
 * accurately compares two tuples while accounting for floating-point errors by considering a small epsilon value.
 *
 * Hint: You can use the Math.abs() function to get the absolute value of a number and compare it with the epsilon value.
 *
 * @param t1 The first tuple to compare.
 * @param t2 The second tuple to compare.
 * @return True if the tuples are considered equal, False otherwise.
 */
fun compareTuples(t1: DoubleArray, t2: DoubleArray): Boolean {

    val epsilon = 1e-9  // Small epsilon value for floating-point comparison

    if (t1.size != t2.size) {
        return false
    }

    for (i in t1.indices) {
        val diff = Math.abs(t1[i] - t2[i])
        if (diff > epsilon) {
            return false
        }
    }

    return true
}