Back to school level Maths :)
You are given input a number, and you want to find the number of trailing zeroes in the value of N! without computing N!
Write a program to compute the nth Fibonacci Number.
Fibonacci Series:
0, 1, 1, 2, 3, 5, 8 , ........
An arithmetic progression (AP) is a sequence where the differences between every two consecutive terms are the same.
An arithmetic progression (AP) is a sequence where the differences between every two consecutive terms are the same.
For example, 1, 5, 9, 13, 17, 21, 25, 29, 33, ...
a = 1 (the first term)
d = 4 (the "common difference" between terms)
For example, 1, 5, 9, 13, 17, 21, 25, 29, 33, ...
a = 1 (the first term)
d = 4 (the "common difference" between terms)
an = a + (n-1)d
Nth term of an AP
For example, 1, 5, 9, 13, 17, 21, 25, 29, 33, ...
a = 1 (the first term)
d = 4 (the "common difference" between terms)
Sn = n(2a + (n-1)d)/2
Sum of N terms of an AP
1, 5, 9, 13, 17, 21, 25, 29, 33, ...
a = 1 (the first term)
d = 4 (the "common difference" between terms)
Sn = (n/2)*(2a + (n-1)d)
Sum of N terms of an AP
A geometric progression is a progression where every term bears a constant ratio to its preceding term.
Text
Combinatorics is all about number of ways of choosing some objects out of a collection and/or number of ways of their arrangement.
For example suppose there are five members in a club, let's say there names are A, B, C, D, and E, and one of them is to be chosen as the coordinator.
Clearly any one out of them can be chosen so there are 5 ways. Now suppose two members are to be chosen for the position of coordinator and co-coordinator. What is the number of ways to choose the two?
Let's generalize it. Permutations of choosing R distinct objects out of a collection of N objects can be calculated using the following formula:
Combinations of choosing R distinct objects out of a collection of N objects can be calculated using the following formula
Suppose there are two sets A and B with finite elements.
The Rule of Product
The product rule states that if there are X number of ways to choose one element from A and Y number of ways to choose one element from B, then there will be X×Y number of ways to choose two elements, one from A and one from B.
The Rule of Sum
The sum rule states that if there are X number of ways to choose one element from A and Y number of ways to choose one element from B, then there will be X+Y number of ways to choose one element that can belong to either A or to B.
Choosing 3 Cats out of 5 Cats?