News5 mins ago
What Does This Mean???
4 Answers
http:// s.wordp ress.co m/latex .php?la tex=%5C display style%7 B%5Cfra c%7Bn%7 D%7Bk%7 D%5Ctim es%5Cfr ac%7Bn- 1%7D%7B k-1%7D% 5Ctimes %5Ccdot s%5Ctim es%5Cfr ac%7Bn- k%2B2%7 D%7B2%7 D%5Ctim es%5Cfr ac%7Bn- k%2B1%7 D%7B1%7 D%7D&am p;bg=T& amp;fg= 000000& amp;s=2
In really simple terms....."Write a function choose(n, k) which takes two integers n and k; we guarantee n>k>0. The function should return the value given in the formula above." I don't particularly understand the maths though :/ I mean what is going to be where the dots are.
In really simple terms....."Write a function choose(n, k) which takes two integers n and k; we guarantee n>k>0. The function should return the value given in the formula above." I don't particularly understand the maths though :/ I mean what is going to be where the dots are.
Answers
Best Answer
No best answer has yet been selected by Goodsoulette. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.What you are given is a series of decreasing terms that have to be multiplied together (much like a factorial)
You start with the fraction n/k where n and k are integers and n>k
Each subsequent terms has the numerator and denominator decreased by 1 and the series continues until the denominator reaches 1.
Neatest solution would be to write a recursive function that calls itself with parameters (n-1), (k-1) until k=1.
You start with the fraction n/k where n and k are integers and n>k
Each subsequent terms has the numerator and denominator decreased by 1 and the series continues until the denominator reaches 1.
Neatest solution would be to write a recursive function that calls itself with parameters (n-1), (k-1) until k=1.
"what is going to be where the dots are?"is that the dots indicate that the pattern continues but some terms are not shown.
So, for example, the first component is n/k as shown, the next is (n-1)/(k-1) as shown, the next (not shown) is (n-2)/(k-2), then it's (n-3)/(k-3). This continues until we get to the final component which is as shown
Replace n and k by numbers such as 6 and 4 to see what's happening. If n=6 and k = 4 the calculation will be:
(6/4) x (5/3) x (4/2) x (3/1)
So, for example, the first component is n/k as shown, the next is (n-1)/(k-1) as shown, the next (not shown) is (n-2)/(k-2), then it's (n-3)/(k-3). This continues until we get to the final component which is as shown
Replace n and k by numbers such as 6 and 4 to see what's happening. If n=6 and k = 4 the calculation will be:
(6/4) x (5/3) x (4/2) x (3/1)