Generating Functions - Mess with coefficients
$begingroup$
Question:
a) Find the coefficient of $x^n$ at the following generating function: $ne^{2x}$
b) Find the coefficient of $frac{x^n}{n!}$ at the following generating function: $n cos x$
My Approach:
It has been proved that $e^x = sum_{n=0}^{infty} frac{x^n}{n!}$ and that $cos x = sum_{n=0}^{infty} (-1)^nfrac{x^{2n}}{(2n)!}$.
Therefore, for (a) we have:
$$
e^{2x}=sum_{n=0}^{infty} frac{(2x)^n}{n!}
$$
Taking the derivative with respect to $x$:
$$
2e^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^{n-1}}{n!}
$$
Multiplying by $x$:
$$
2xe^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^n}{n!} = sum_{n=0}^{infty}frac{2^n cdot x^n}{(n-1)!}
$$
Therefore:
$$
frac{2^n}{(n-1)!}
$$
is the coefficient... But that's the coefficient for the function $2xe^{2x}$. I don't know if I am missing something, but it's not clear to me what $n e^{2x}$ is... I did the same thing for (b), but I'll hide the details.
Maybe that $n$ is just a constant with different index, and therefore we're actually looking for:
$$
n e^{2x} = n (sum frac{2^k x^k}{k!}) underbrace{rightarrow}_{text{Coef. of }x^k} frac{n 2^k}{k!}
$$
... But I can't think about that because we're asked to find the coefficient of $x^n$, and therefore the index of the infinite series that represent $e^x$ is $n$... What a MESS!
Can someone please clarify to me what is going on with that $n$ multiplying the functions in terms of $x$?
Thank you!
combinatorics generating-functions
$endgroup$
add a comment |
$begingroup$
Question:
a) Find the coefficient of $x^n$ at the following generating function: $ne^{2x}$
b) Find the coefficient of $frac{x^n}{n!}$ at the following generating function: $n cos x$
My Approach:
It has been proved that $e^x = sum_{n=0}^{infty} frac{x^n}{n!}$ and that $cos x = sum_{n=0}^{infty} (-1)^nfrac{x^{2n}}{(2n)!}$.
Therefore, for (a) we have:
$$
e^{2x}=sum_{n=0}^{infty} frac{(2x)^n}{n!}
$$
Taking the derivative with respect to $x$:
$$
2e^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^{n-1}}{n!}
$$
Multiplying by $x$:
$$
2xe^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^n}{n!} = sum_{n=0}^{infty}frac{2^n cdot x^n}{(n-1)!}
$$
Therefore:
$$
frac{2^n}{(n-1)!}
$$
is the coefficient... But that's the coefficient for the function $2xe^{2x}$. I don't know if I am missing something, but it's not clear to me what $n e^{2x}$ is... I did the same thing for (b), but I'll hide the details.
Maybe that $n$ is just a constant with different index, and therefore we're actually looking for:
$$
n e^{2x} = n (sum frac{2^k x^k}{k!}) underbrace{rightarrow}_{text{Coef. of }x^k} frac{n 2^k}{k!}
$$
... But I can't think about that because we're asked to find the coefficient of $x^n$, and therefore the index of the infinite series that represent $e^x$ is $n$... What a MESS!
Can someone please clarify to me what is going on with that $n$ multiplying the functions in terms of $x$?
Thank you!
combinatorics generating-functions
$endgroup$
1
$begingroup$
That $n$ in front of $e^{2x}$ and $cos(x)$ doesn't make sense.
$endgroup$
– marty cohen
Dec 3 '18 at 1:04
$begingroup$
@martycohen Yeah, I agree with you... Ty anyway
$endgroup$
– Bruno Reis
Dec 3 '18 at 1:13
$begingroup$
@martycohen: I've added an answer which might be interesting.
$endgroup$
– Markus Scheuer
Dec 4 '18 at 9:44
add a comment |
$begingroup$
Question:
a) Find the coefficient of $x^n$ at the following generating function: $ne^{2x}$
b) Find the coefficient of $frac{x^n}{n!}$ at the following generating function: $n cos x$
My Approach:
It has been proved that $e^x = sum_{n=0}^{infty} frac{x^n}{n!}$ and that $cos x = sum_{n=0}^{infty} (-1)^nfrac{x^{2n}}{(2n)!}$.
Therefore, for (a) we have:
$$
e^{2x}=sum_{n=0}^{infty} frac{(2x)^n}{n!}
$$
Taking the derivative with respect to $x$:
$$
2e^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^{n-1}}{n!}
$$
Multiplying by $x$:
$$
2xe^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^n}{n!} = sum_{n=0}^{infty}frac{2^n cdot x^n}{(n-1)!}
$$
Therefore:
$$
frac{2^n}{(n-1)!}
$$
is the coefficient... But that's the coefficient for the function $2xe^{2x}$. I don't know if I am missing something, but it's not clear to me what $n e^{2x}$ is... I did the same thing for (b), but I'll hide the details.
Maybe that $n$ is just a constant with different index, and therefore we're actually looking for:
$$
n e^{2x} = n (sum frac{2^k x^k}{k!}) underbrace{rightarrow}_{text{Coef. of }x^k} frac{n 2^k}{k!}
$$
... But I can't think about that because we're asked to find the coefficient of $x^n$, and therefore the index of the infinite series that represent $e^x$ is $n$... What a MESS!
Can someone please clarify to me what is going on with that $n$ multiplying the functions in terms of $x$?
Thank you!
combinatorics generating-functions
$endgroup$
Question:
a) Find the coefficient of $x^n$ at the following generating function: $ne^{2x}$
b) Find the coefficient of $frac{x^n}{n!}$ at the following generating function: $n cos x$
My Approach:
It has been proved that $e^x = sum_{n=0}^{infty} frac{x^n}{n!}$ and that $cos x = sum_{n=0}^{infty} (-1)^nfrac{x^{2n}}{(2n)!}$.
Therefore, for (a) we have:
$$
e^{2x}=sum_{n=0}^{infty} frac{(2x)^n}{n!}
$$
Taking the derivative with respect to $x$:
$$
2e^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^{n-1}}{n!}
$$
Multiplying by $x$:
$$
2xe^{2x}=sum_{n=0}^{infty} nfrac{2^ncdot x^n}{n!} = sum_{n=0}^{infty}frac{2^n cdot x^n}{(n-1)!}
$$
Therefore:
$$
frac{2^n}{(n-1)!}
$$
is the coefficient... But that's the coefficient for the function $2xe^{2x}$. I don't know if I am missing something, but it's not clear to me what $n e^{2x}$ is... I did the same thing for (b), but I'll hide the details.
Maybe that $n$ is just a constant with different index, and therefore we're actually looking for:
$$
n e^{2x} = n (sum frac{2^k x^k}{k!}) underbrace{rightarrow}_{text{Coef. of }x^k} frac{n 2^k}{k!}
$$
... But I can't think about that because we're asked to find the coefficient of $x^n$, and therefore the index of the infinite series that represent $e^x$ is $n$... What a MESS!
Can someone please clarify to me what is going on with that $n$ multiplying the functions in terms of $x$?
Thank you!
combinatorics generating-functions
combinatorics generating-functions
edited Dec 3 '18 at 0:57
Bruno Reis
asked Dec 3 '18 at 0:08
Bruno ReisBruno Reis
982418
982418
1
$begingroup$
That $n$ in front of $e^{2x}$ and $cos(x)$ doesn't make sense.
$endgroup$
– marty cohen
Dec 3 '18 at 1:04
$begingroup$
@martycohen Yeah, I agree with you... Ty anyway
$endgroup$
– Bruno Reis
Dec 3 '18 at 1:13
$begingroup$
@martycohen: I've added an answer which might be interesting.
$endgroup$
– Markus Scheuer
Dec 4 '18 at 9:44
add a comment |
1
$begingroup$
That $n$ in front of $e^{2x}$ and $cos(x)$ doesn't make sense.
$endgroup$
– marty cohen
Dec 3 '18 at 1:04
$begingroup$
@martycohen Yeah, I agree with you... Ty anyway
$endgroup$
– Bruno Reis
Dec 3 '18 at 1:13
$begingroup$
@martycohen: I've added an answer which might be interesting.
$endgroup$
– Markus Scheuer
Dec 4 '18 at 9:44
1
1
$begingroup$
That $n$ in front of $e^{2x}$ and $cos(x)$ doesn't make sense.
$endgroup$
– marty cohen
Dec 3 '18 at 1:04
$begingroup$
That $n$ in front of $e^{2x}$ and $cos(x)$ doesn't make sense.
$endgroup$
– marty cohen
Dec 3 '18 at 1:04
$begingroup$
@martycohen Yeah, I agree with you... Ty anyway
$endgroup$
– Bruno Reis
Dec 3 '18 at 1:13
$begingroup$
@martycohen Yeah, I agree with you... Ty anyway
$endgroup$
– Bruno Reis
Dec 3 '18 at 1:13
$begingroup$
@martycohen: I've added an answer which might be interesting.
$endgroup$
– Markus Scheuer
Dec 4 '18 at 9:44
$begingroup$
@martycohen: I've added an answer which might be interesting.
$endgroup$
– Markus Scheuer
Dec 4 '18 at 9:44
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
It is sufficient to clarify a.) since we can use the same arguments for b.). It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series.
At first we look at a specific case, for instance $n=5$:
Find the coefficient of $x^5$ at the following generating function $5e^{2x}$.
This is easy to calculate, since we have no notational difficult situation.
begin{align*}
color{blue}{[x^5]left(5e^{2x}right)}&=5[x^5]sum_{k=0}^infty frac{(2x)^{k}}{k!}\
&=5cdotfrac{2^5}{5!}\
&,,color{blue}{=frac{4}{3}}
end{align*}
Now the problem a.)
Find the coefficient of $x^n$ at the following generating function $ne^{2x}$.
Note that $n$ is a variable independent of any series representation of $e^{2x}$. When expanding the series we conveniently use an index variable which is different to $n$.
begin{align*}
color{blue}{[x^n]left(ne^{2x}right)}&=n[x^n]sum_{k=0}^infty frac{(2x)^{k}}{k!}tag{1}\
&=ncdotfrac{2^n}{n!}\
&,,color{blue}{=frac{2^n}{(n-1)!}}
end{align*}
Note: The index variable $k$ in (1) is a so-called bound variable. This means that the scope (i.e. range of validity) is determined by the sigma-operator $sum$ and the operator precedence rules.
In fact it is even correct to write
begin{align*}
color{blue}{n}e^{2x}&=color{blue}{n}sum_{n=0}^infty frac{(2x)^n}{n!}tag{2}
end{align*}
where the factor $color{blue}{n}$ outside the sum is a free variable different to the bound index variable $n$ of the sigma-operator $sum$. But of course this is a misuse of notation and strictly to avoid in order to support readability of the text.
Side note: A great example of a notational misuse is given by Richard P. Stanley in this MO post.
$endgroup$
$begingroup$
Thanks. Perfect answer
$endgroup$
– Bruno Reis
Dec 3 '18 at 21:36
1
$begingroup$
@BrunoReis: You're welcome.
$endgroup$
– Markus Scheuer
Dec 3 '18 at 21:36
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3023414%2fgenerating-functions-mess-with-coefficients%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
It is sufficient to clarify a.) since we can use the same arguments for b.). It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series.
At first we look at a specific case, for instance $n=5$:
Find the coefficient of $x^5$ at the following generating function $5e^{2x}$.
This is easy to calculate, since we have no notational difficult situation.
begin{align*}
color{blue}{[x^5]left(5e^{2x}right)}&=5[x^5]sum_{k=0}^infty frac{(2x)^{k}}{k!}\
&=5cdotfrac{2^5}{5!}\
&,,color{blue}{=frac{4}{3}}
end{align*}
Now the problem a.)
Find the coefficient of $x^n$ at the following generating function $ne^{2x}$.
Note that $n$ is a variable independent of any series representation of $e^{2x}$. When expanding the series we conveniently use an index variable which is different to $n$.
begin{align*}
color{blue}{[x^n]left(ne^{2x}right)}&=n[x^n]sum_{k=0}^infty frac{(2x)^{k}}{k!}tag{1}\
&=ncdotfrac{2^n}{n!}\
&,,color{blue}{=frac{2^n}{(n-1)!}}
end{align*}
Note: The index variable $k$ in (1) is a so-called bound variable. This means that the scope (i.e. range of validity) is determined by the sigma-operator $sum$ and the operator precedence rules.
In fact it is even correct to write
begin{align*}
color{blue}{n}e^{2x}&=color{blue}{n}sum_{n=0}^infty frac{(2x)^n}{n!}tag{2}
end{align*}
where the factor $color{blue}{n}$ outside the sum is a free variable different to the bound index variable $n$ of the sigma-operator $sum$. But of course this is a misuse of notation and strictly to avoid in order to support readability of the text.
Side note: A great example of a notational misuse is given by Richard P. Stanley in this MO post.
$endgroup$
$begingroup$
Thanks. Perfect answer
$endgroup$
– Bruno Reis
Dec 3 '18 at 21:36
1
$begingroup$
@BrunoReis: You're welcome.
$endgroup$
– Markus Scheuer
Dec 3 '18 at 21:36
add a comment |
$begingroup$
It is sufficient to clarify a.) since we can use the same arguments for b.). It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series.
At first we look at a specific case, for instance $n=5$:
Find the coefficient of $x^5$ at the following generating function $5e^{2x}$.
This is easy to calculate, since we have no notational difficult situation.
begin{align*}
color{blue}{[x^5]left(5e^{2x}right)}&=5[x^5]sum_{k=0}^infty frac{(2x)^{k}}{k!}\
&=5cdotfrac{2^5}{5!}\
&,,color{blue}{=frac{4}{3}}
end{align*}
Now the problem a.)
Find the coefficient of $x^n$ at the following generating function $ne^{2x}$.
Note that $n$ is a variable independent of any series representation of $e^{2x}$. When expanding the series we conveniently use an index variable which is different to $n$.
begin{align*}
color{blue}{[x^n]left(ne^{2x}right)}&=n[x^n]sum_{k=0}^infty frac{(2x)^{k}}{k!}tag{1}\
&=ncdotfrac{2^n}{n!}\
&,,color{blue}{=frac{2^n}{(n-1)!}}
end{align*}
Note: The index variable $k$ in (1) is a so-called bound variable. This means that the scope (i.e. range of validity) is determined by the sigma-operator $sum$ and the operator precedence rules.
In fact it is even correct to write
begin{align*}
color{blue}{n}e^{2x}&=color{blue}{n}sum_{n=0}^infty frac{(2x)^n}{n!}tag{2}
end{align*}
where the factor $color{blue}{n}$ outside the sum is a free variable different to the bound index variable $n$ of the sigma-operator $sum$. But of course this is a misuse of notation and strictly to avoid in order to support readability of the text.
Side note: A great example of a notational misuse is given by Richard P. Stanley in this MO post.
$endgroup$
$begingroup$
Thanks. Perfect answer
$endgroup$
– Bruno Reis
Dec 3 '18 at 21:36
1
$begingroup$
@BrunoReis: You're welcome.
$endgroup$
– Markus Scheuer
Dec 3 '18 at 21:36
add a comment |
$begingroup$
It is sufficient to clarify a.) since we can use the same arguments for b.). It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series.
At first we look at a specific case, for instance $n=5$:
Find the coefficient of $x^5$ at the following generating function $5e^{2x}$.
This is easy to calculate, since we have no notational difficult situation.
begin{align*}
color{blue}{[x^5]left(5e^{2x}right)}&=5[x^5]sum_{k=0}^infty frac{(2x)^{k}}{k!}\
&=5cdotfrac{2^5}{5!}\
&,,color{blue}{=frac{4}{3}}
end{align*}
Now the problem a.)
Find the coefficient of $x^n$ at the following generating function $ne^{2x}$.
Note that $n$ is a variable independent of any series representation of $e^{2x}$. When expanding the series we conveniently use an index variable which is different to $n$.
begin{align*}
color{blue}{[x^n]left(ne^{2x}right)}&=n[x^n]sum_{k=0}^infty frac{(2x)^{k}}{k!}tag{1}\
&=ncdotfrac{2^n}{n!}\
&,,color{blue}{=frac{2^n}{(n-1)!}}
end{align*}
Note: The index variable $k$ in (1) is a so-called bound variable. This means that the scope (i.e. range of validity) is determined by the sigma-operator $sum$ and the operator precedence rules.
In fact it is even correct to write
begin{align*}
color{blue}{n}e^{2x}&=color{blue}{n}sum_{n=0}^infty frac{(2x)^n}{n!}tag{2}
end{align*}
where the factor $color{blue}{n}$ outside the sum is a free variable different to the bound index variable $n$ of the sigma-operator $sum$. But of course this is a misuse of notation and strictly to avoid in order to support readability of the text.
Side note: A great example of a notational misuse is given by Richard P. Stanley in this MO post.
$endgroup$
It is sufficient to clarify a.) since we can use the same arguments for b.). It is convenient to use the coefficient of operator $[x^k]$ to denote the coefficient of $x^k$ in a series.
At first we look at a specific case, for instance $n=5$:
Find the coefficient of $x^5$ at the following generating function $5e^{2x}$.
This is easy to calculate, since we have no notational difficult situation.
begin{align*}
color{blue}{[x^5]left(5e^{2x}right)}&=5[x^5]sum_{k=0}^infty frac{(2x)^{k}}{k!}\
&=5cdotfrac{2^5}{5!}\
&,,color{blue}{=frac{4}{3}}
end{align*}
Now the problem a.)
Find the coefficient of $x^n$ at the following generating function $ne^{2x}$.
Note that $n$ is a variable independent of any series representation of $e^{2x}$. When expanding the series we conveniently use an index variable which is different to $n$.
begin{align*}
color{blue}{[x^n]left(ne^{2x}right)}&=n[x^n]sum_{k=0}^infty frac{(2x)^{k}}{k!}tag{1}\
&=ncdotfrac{2^n}{n!}\
&,,color{blue}{=frac{2^n}{(n-1)!}}
end{align*}
Note: The index variable $k$ in (1) is a so-called bound variable. This means that the scope (i.e. range of validity) is determined by the sigma-operator $sum$ and the operator precedence rules.
In fact it is even correct to write
begin{align*}
color{blue}{n}e^{2x}&=color{blue}{n}sum_{n=0}^infty frac{(2x)^n}{n!}tag{2}
end{align*}
where the factor $color{blue}{n}$ outside the sum is a free variable different to the bound index variable $n$ of the sigma-operator $sum$. But of course this is a misuse of notation and strictly to avoid in order to support readability of the text.
Side note: A great example of a notational misuse is given by Richard P. Stanley in this MO post.
edited Dec 4 '18 at 9:45
answered Dec 3 '18 at 21:05
Markus ScheuerMarkus Scheuer
60.7k455145
60.7k455145
$begingroup$
Thanks. Perfect answer
$endgroup$
– Bruno Reis
Dec 3 '18 at 21:36
1
$begingroup$
@BrunoReis: You're welcome.
$endgroup$
– Markus Scheuer
Dec 3 '18 at 21:36
add a comment |
$begingroup$
Thanks. Perfect answer
$endgroup$
– Bruno Reis
Dec 3 '18 at 21:36
1
$begingroup$
@BrunoReis: You're welcome.
$endgroup$
– Markus Scheuer
Dec 3 '18 at 21:36
$begingroup$
Thanks. Perfect answer
$endgroup$
– Bruno Reis
Dec 3 '18 at 21:36
$begingroup$
Thanks. Perfect answer
$endgroup$
– Bruno Reis
Dec 3 '18 at 21:36
1
1
$begingroup$
@BrunoReis: You're welcome.
$endgroup$
– Markus Scheuer
Dec 3 '18 at 21:36
$begingroup$
@BrunoReis: You're welcome.
$endgroup$
– Markus Scheuer
Dec 3 '18 at 21:36
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3023414%2fgenerating-functions-mess-with-coefficients%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
That $n$ in front of $e^{2x}$ and $cos(x)$ doesn't make sense.
$endgroup$
– marty cohen
Dec 3 '18 at 1:04
$begingroup$
@martycohen Yeah, I agree with you... Ty anyway
$endgroup$
– Bruno Reis
Dec 3 '18 at 1:13
$begingroup$
@martycohen: I've added an answer which might be interesting.
$endgroup$
– Markus Scheuer
Dec 4 '18 at 9:44