What is the domain and range of the function f(x) = |x| ?
Note: You might be wondering what |x| means. This is called the absolute value of x... also known as the distance from zero. For example, absolute value of -4 is 4, because -4 is four away from zero. That is |-4| = 4. (Picture a number line!) First, let's think about the domain. You can think of domain as all the valid input to the function. Is there any number that you cannot plug into the function? Well, we can plug in positive numbers... f(5) = |5| = 5. Can we plug in decimals? Yes we can! f(2.7) = |2.7| = 2.7 Okay, how about negative numbers? f(-3) = |-3| = 3 So it seems that you can plug in ANY number and it is still valid! Now we can consider the range. Range is all the possible values are function can output. Can our function output positive numbers? Yes, it can - all the values are the distance from zero, and distance is always positive. Can our function output zero? Well, if we plug in 0 into our function, we get 0 as the output! Can our function output negative numbers? Let's try some numbers. f(-2) = |-2| = 2. Nope. 2 is positive. f(3) = |3| = 3. Nope. f(-2000) = |-2000| = 2000. Nope. So it seems that no matter what we do we always get a positive number (or zero). So that means that the range is any number greater than or equal to zero!
What is the difference between public and private in Java?
For people new to Java, this is a very common question to ask. The keywords 'public' and 'private' are called modifiers. When you declare objects/classes/methods in Java, you can put these keywords in the declaration. For simplicity, I will explain how modifiers apply to objects. If you use the word 'public' that means that the object is accessible to not just the class you declared it in, but also any other classes have access to the object. If you use the word 'private' that means ONLY the class you declared the object in has access to the object. This can be useful because it allows you to control exactly what can access the variables or methods inside certain classes. You might not want to expose some stuff to anyone else, and you might not want to reveal all the details to the outside world. That is where access modifiers come in handy :)
Given that f(x) = x^3 - 5, find f''(x).
The question wants us to find the SECOND derivative of f(x). To find the first derivative, we can apply the power rule to the first term, x^3 which gives us 3x^2. Then we look at the second term -5 which is zero since a derivative of a constant value is just zero. This gives us f'(x) = 3x^2. To find the second derivative, we just have to take the derivative of f'(x). Again, notice that we can apply the power rule, which results in 3*(2x) = 6x. We applied the power rule to the x^2 term, remembering to keep the constant factor. Therefore, the answer is f''(x) = 6x.