-3

I am trying to understand the following question, and honestly have no idea from where to start it seems like it asking for factorial of $n$ terms in a form of $g(n)$?

Define $g(n):=f(n!)$. We want to find a closed formula for $g(n)$. First of all, we want to find a recurrence for $g(n)$. If n is odd, then it is pretty easy to see that $g(n)=g(n−1)$. If n is even, try to write $g(n)$ in terms of $g(n/2)$.

Can someone help thanks.

That the only definition of f given

That the only definition of f I have from above question which basically like a remainder of 0 in a binary number like how many 0 are after last 1

enter image description here

Here is the screen shot of the question enter image description here

Sil
  • 16,612
COLD TOLD
  • 107
  • 6
  • 5
    To me this sounds like it could only make sense if you have a definition for $f$ first. Do you have a definition for the function $f$? – 2'5 9'2 Aug 11 '18 at 22:41
  • from the question it seems like (n!) – COLD TOLD Aug 11 '18 at 22:49
  • 2
    Surely there is more information given in the question or surrounding questions about the function $f$ and the function $g$. Until you provide us with more information the question is impossible to answer. – JMoravitz Aug 11 '18 at 22:54
  • 1
    To emphasize the point, here are two extreme examples. Suppose that $f(n)=0$ for all $n$. Then we would have $g(n)=f(n!)=0$ for all $n$. For another example, suppose that $f(n)$ outputs the largest power of $2$ which divides $n$. In that case we would indeed have $g(n)=g(n-1)$ for every odd $n$ (something which isn't common), but in this example $g$ is much more complicated of a function than simply outputting zero for every result. These two functions are incredibly different, and until you tell us more about what $f$ is actually supposed to be, we can only use our imaginations. – JMoravitz Aug 11 '18 at 23:02
  • I added a screen shot – COLD TOLD Aug 11 '18 at 23:03
  • 1
    You provided us with a screenshot of that one specific part of a question and $f$ is not defined there. What about the question before that? What about the beginning of the section of questions? If $f$ is not defined within the paragraph you screenshotted, then it must have been defined elsewhere. – JMoravitz Aug 11 '18 at 23:04
  • Provided an f definition only definition given tin above question thru out the assignment – COLD TOLD Aug 11 '18 at 23:18
  • 2
    Finally. Please provide such important definitions when you first post the question. Ironically, my second example in my second comment was almost the exact definition for $f$. Now, before working on solving the problem, we should work on making sure that you understand what is being asked. Do you understand what the function $f$ is and how to calculate for example, $f(4), f(6), f(9), f(24)$? – JMoravitz Aug 11 '18 at 23:32
  • 1
    Once you are comfortable with the definition for $f$, the problem asks us to find a closed form for the function $g$, where $g$ is defined as $g(n)=\text{max}{k\in\Bbb N~\text{such that}~2^k~\text{divides}~ n!}$. For example $g(1)=0, g(2)=1, g(3)=1, g(4)=3, g(5)=3, g(6)=4$ etc... – JMoravitz Aug 11 '18 at 23:40

1 Answers1

2

Hints:

$(2k+1)! = \begin{array}{l}\color{grey}{1~~\cdot 3~~\cdot 5~~\cdot 7~~\cdots (2k-3)~~~~\cdot (2k-1)~~~\cdot(2k+1)}\\~~\cdot 2~~\cdot 4~~\cdot 6~~\cdot 8\cdots~~~~\cdot(2k-2)~~~~~\cdot (2k)\end{array}$

Noting that the odd factors in grey contribute nothing to the largest power of $2$ which divides $(2k+1)!$ we see that $g(2n+1)=g(2n)$.

$(2k)! = \begin{array}{l}\color{grey}{1~~\cdot 3~~\cdot 5~~\cdot 7~~\cdots (2k-3)~~~~\cdot (2k-1)}\\~~\cdot 2~~\cdot 4~~\cdot 6~~\cdot 8\cdots~~~~\cdot(2k-2)~~~~\cdot(2k)\end{array}$

$=\color{grey}{(1\cdot 3\cdot 5\cdots (2k-3)\cdot (2k-1))}\cdot (2\cdot 4\cdot 6\cdots (2k-2)(2k))$

$=\color{grey}{(1\cdot 3\cdot 5\cdots (2k-3)\cdot (2k-1))}\cdot ((2\cdot 1)\cdot (2\cdot 2)\cdot (2\cdot 3)\cdots (2\cdot(k-1))\cdot (2\cdot k))$

$=\color{grey}{(1\cdot 3\cdot 5\cdots (2k-3)\cdot (2k-1))}\cdot 2^k\cdot k!$

Notice that the odd factors in grey contribute nothing to the largest power of $2$ which divides $(2k)!$

You should be able now to recognize the relationship between $g(2k)$ and $g(k)$. Armed with this knowledge, you should be able to find $g(8000000000000)-g(4000000000000)$ with almost no effort.

Additional hint:

Recognize that $g(2k)$ counts the number of factors of $2$ occurring in $(2k)!$ and $g(k)$ counts the number of factors of $2$ occurring in $k!$. Recognize that $(2k)!$ is equal to an odd number (which has no factors of $2$) times $2^k$ times $k!$. So, the only additional factors of $2$ which are present between $(2k)!$ and $k!$ are those that occur as a result of $2^k$.

Solution:

$g(2n)-g(n)=n$


The above helps us to come up with a recursive definition for $g$, but it is not particularly helpful for finding a closed form for $g$ (that I immediately see).

That being said, when calculating $g(n)$ notice that every multiple of $2$ less than or equal to $n$ will contribute one to the total of the largest exponent of $2$ that divides $n!$. Further, each multiple of four less than or equal to $n$ will contribute yet an additional one to the total, and further each multiple of eight will and so on.

You should be able to formalize these observations in order to express $g(n)$ in closed form using an infinite sum.

This should remind you a great deal of the problem of counting how many trailing zeroes are at the end of a factorial, see for example here.

JMoravitz
  • 79,518
  • As I was reading your comments I guess it makes me a little more confused lets me state the following that I do understand 1) $g(n)=\text{max}{k\in\Bbb N~\text{such that}~2^k~\text{divides}~ n!}$ which i do get is the largest number in pover of 2 that divides n! which basically what you showed in the comment, does that mean that in order to solve $g(8000000000000)-g(4000000000000)$ I have to follow the same technique and find the larges power of 2 that divides 8000000000000? – COLD TOLD Aug 12 '18 at 02:18
  • @COLDTOLD No. You don't actually need to know the value of $g(8000000000000)$ at all. Neither do you need to know the value of $g(4000000000000)$. Again, see if you can find the simplification of $g(2n)-g(n)$. – JMoravitz Aug 12 '18 at 02:33
  • Thank you very much, I appreciate your effort in helping me a lot, I think it often gets confusing to me to see what problem is asking, if it written in a way like described, It also a little hard taking on-line course when you watch a video for 20 min which has clear example an explanation and then forced to solve something much more difficult, I might have some more question about other problem but, trying to solve it by myself. I am very glad to be able to find explanation and help on line. Thank You – COLD TOLD Aug 12 '18 at 02:51
  • I wonder if you would have some time to help me with this problem, For $n \in \mathbb{N}$ let w(n) denote the number of 1s in the binary representation of n. For example, w(9)=2, since $9$ is 1001 in binary. Try to find a closed formula for g(n) in terms of n and w(n). I was trying to follow your explanation of above problem but everything I try seems to be wrong. If not it fine just don't want to be annoying. – COLD TOLD Aug 14 '18 at 02:05