Permutation-and-Combination
Question 1 |
P = Q - k
| |
P = Q + k | |
P = Q
| |
P = Q +2 k
|
Question 1 Explanation:

P=1+3+5+7+...+(2k-1)
=(2-1)+(4-1)+(6-1)+(8-1)+...+(2k-1)
=(2+4+6+8+...+2k)+(-1+-1+-1+k times)
=Q-(1+1+...+k times)
=Q-k
Question 2 |
The number of substrings (of all lengths inclusive) that can be formed from a character string of length n is
n | |
n2 | |
![]() | |
![]() |
Question 2 Explanation:
No. of substrings of length
n = 1
(n-1) = 2
(n-2) = 3
So, Total = n(n+1)/2
n = 1
(n-1) = 2
(n-2) = 3
So, Total = n(n+1)/2
There are 2 questions to complete.