Hi,
First of all, I am new to this place, just finding where to post questions were hard and I am not sure this is the right place for it still. "Start contributing" for "Great problem or idea" is apparently where you get to the discussion part which threw me off but I guess I just need to get to know the platform. I got stuck on the introduction of dynamic programming.
There is a function that under certain conditions can return or . The final answer is given as .
I may not understand mathematical notation well enough but I was fairly sure that means the sum of where will start at and go to . Typically would have some reference to in it since otherwise you might as well multiply by . The point is that in the case of the answer is a recursive function evaluation and no other condition or operation outside of it, it can only evaluate to which happens when the is and the sum become a no operation which I assume returns the scalar in this case.
How can this function implement the conditions described as the target conditions of the algorithm, like return when is zero?
Best Regards
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Note that the correct answer in the referenced question is (A) - f(N,S)=∑i=0n−1f(N−ai,remove(S,ai)) Here the summation index is i, as expected. There seems to be a typo in the explanation to this question. You can report this mistake as explained in this link - reporting a mistake
Log in to reply
I didn't notice that but it still doesn't explain how the function could ever return anything other than 0 (assuming that summation over an empty set is zero).
Log in to reply
Remember that f(0,S)=1 for all S. Thus, if ever f(0, S) is called, the end result will be greater than 0. Therefore, if N-a[i] is ever 0, the end result will be greater than 0. Therefore, if N ever equals a[i], the end result will be greater than 0.
I'm sure you can concieve of a situation in which N can equal a[i], right? Thus, there are ways that the function could return something other than zero. Does that make sense?
Log in to reply
Like Oded and you pointed out, there had been a typo in the summation indices. This has been fixed now. Do you think this makes more sense now?
Log in to reply
No. The thing I am having problems with is how to know when a condition is part of the problem description or when it is part of the answer. It seems to me that the conditions outlined in the problem description somehow applies even though no such conditions are present in the formula that supposedly is the right answer. What course should I take to get a good understanding of the mathematical notation used?
Log in to reply
What is given to you is N, a number and S, a set of numbers. The question, then, is whether you can pick a subset of elements in S such that they sum up to N. To understand the explanation, I suggest you go through the example given and work it out yourself. Feel free to ask me related questions that you may have.
Being able to interpret notation is a skill that comes with mathematical maturity. It gets better with a practice of reading mathematical literature like you are doing right now. (So, good job!) In my few years of mathematics studentship, I have come across several pieces of strange notation, and often it stumps me too.
Log in to reply
Log in to reply
f can indeed be rigorously defined through mathematical notation, or via means of a programming language if necessary.
I am sorry, I believe you misunderstood my comment. The format of the expression is by no means a guessing game. The function