- What is the square root of 10?
- What is the logarithm of 32 to the base2?
- What is the sum of the numbers from 1 to 1000?
- What is the sum of all even numbers from 2 to 1000?
even <- seq(2, 1000, by = 2)
sum(even)
- How many pairwise comparisons are there for 100 genes?
pairs <- 100*(100-1)/2
pairs
- How many ways to arrange 100 genes in triples?
#number of combinations of x genes out of n
combi <- function(n, x) {
if(x > n || x < 0) {
stop(paste0("x must be between 0 and ", n))
}
return(choose(n, x))
}
combi(100,3)