Solve for $lambda(x): mathbb N to mathbb N$ given two cases.












1












$begingroup$



Solve for $lambda:Bbb NtoBbb N$ in $lambda(x)=begin{cases}
x+1 & xin2Bbb N \
2lambda(lfloor x/2rfloor) & xin2Bbb N+1
end{cases}$




I know that an answer is $lambda(x)=x+1$, but is it the only one?



We know it is true for $xin2Bbb N$, but what about $xin 2Bbb N+1$?



Let $x=2k+1$ for some $kin Bbb N$.



Then $lambda(2k+1)=2lambda(lfloor (2k+1)/2rfloor)=2lambda(lfloor k+1/2rfloor)=2lambda(k)$



But now we are in the same scenario, having to check the parity of $k$ to be able to progress.



Is there a way to prove this, maybe inductively? Thanks.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Best not to format "cases" in a title.
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:54










  • $begingroup$
    Garmekain ^^^^^
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:59
















1












$begingroup$



Solve for $lambda:Bbb NtoBbb N$ in $lambda(x)=begin{cases}
x+1 & xin2Bbb N \
2lambda(lfloor x/2rfloor) & xin2Bbb N+1
end{cases}$




I know that an answer is $lambda(x)=x+1$, but is it the only one?



We know it is true for $xin2Bbb N$, but what about $xin 2Bbb N+1$?



Let $x=2k+1$ for some $kin Bbb N$.



Then $lambda(2k+1)=2lambda(lfloor (2k+1)/2rfloor)=2lambda(lfloor k+1/2rfloor)=2lambda(k)$



But now we are in the same scenario, having to check the parity of $k$ to be able to progress.



Is there a way to prove this, maybe inductively? Thanks.










share|cite|improve this question











$endgroup$












  • $begingroup$
    Best not to format "cases" in a title.
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:54










  • $begingroup$
    Garmekain ^^^^^
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:59














1












1








1





$begingroup$



Solve for $lambda:Bbb NtoBbb N$ in $lambda(x)=begin{cases}
x+1 & xin2Bbb N \
2lambda(lfloor x/2rfloor) & xin2Bbb N+1
end{cases}$




I know that an answer is $lambda(x)=x+1$, but is it the only one?



We know it is true for $xin2Bbb N$, but what about $xin 2Bbb N+1$?



Let $x=2k+1$ for some $kin Bbb N$.



Then $lambda(2k+1)=2lambda(lfloor (2k+1)/2rfloor)=2lambda(lfloor k+1/2rfloor)=2lambda(k)$



But now we are in the same scenario, having to check the parity of $k$ to be able to progress.



Is there a way to prove this, maybe inductively? Thanks.










share|cite|improve this question











$endgroup$





Solve for $lambda:Bbb NtoBbb N$ in $lambda(x)=begin{cases}
x+1 & xin2Bbb N \
2lambda(lfloor x/2rfloor) & xin2Bbb N+1
end{cases}$




I know that an answer is $lambda(x)=x+1$, but is it the only one?



We know it is true for $xin2Bbb N$, but what about $xin 2Bbb N+1$?



Let $x=2k+1$ for some $kin Bbb N$.



Then $lambda(2k+1)=2lambda(lfloor (2k+1)/2rfloor)=2lambda(lfloor k+1/2rfloor)=2lambda(k)$



But now we are in the same scenario, having to check the parity of $k$ to be able to progress.



Is there a way to prove this, maybe inductively? Thanks.







functions






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 16 '18 at 22:58









Namaste

1




1










asked Dec 16 '18 at 22:50









GarmekainGarmekain

1,502720




1,502720












  • $begingroup$
    Best not to format "cases" in a title.
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:54










  • $begingroup$
    Garmekain ^^^^^
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:59


















  • $begingroup$
    Best not to format "cases" in a title.
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:54










  • $begingroup$
    Garmekain ^^^^^
    $endgroup$
    – Namaste
    Dec 16 '18 at 22:59
















$begingroup$
Best not to format "cases" in a title.
$endgroup$
– Namaste
Dec 16 '18 at 22:54




$begingroup$
Best not to format "cases" in a title.
$endgroup$
– Namaste
Dec 16 '18 at 22:54












$begingroup$
Garmekain ^^^^^
$endgroup$
– Namaste
Dec 16 '18 at 22:59




$begingroup$
Garmekain ^^^^^
$endgroup$
– Namaste
Dec 16 '18 at 22:59










1 Answer
1






active

oldest

votes


















2












$begingroup$

Hint: Does the base-2 expansion of the input $x$ tell you anything?



Solution:
The base-2 expansion of the input $x$ has $m$ trailing 1s: $$x equiv ( d_1 ldots d_n 0 underbrace{1 cdots 1}_m )_2.$$ Note that $x$ is even if and only if $m = 0$. If $m geq 1$, the operation $lfloor x / 2 rfloor$ is equivalent to removing the last trailing 1 from the above expansion. Therefore, begin{multline*}lambda(x) = 2^m lambda( (d_1 ldots d_n 0)_2 ) = 2^m left[(d_1 ldots d_n 0)_2 + 1 right] \ = 2^m (d_1 ldots d_n 1)_2 = (d_1 ldots d_n 1 underbrace{0 cdots 0}_m)_2 = x + 1.end{multline*}






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Exactly. But how can it be proved that $x+1$ is the only solution for $lambda$?
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:02






  • 1




    $begingroup$
    Try looking at the base-2 expansion of $23$, $lfloor 23 / 2 rfloor = 11$, $lfloor 11 / 2 rfloor = 5$, and $lfloor 5 / 2 rfloor = 2$. You should be able to spot a pattern that you can generalize from.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:05












  • $begingroup$
    Does the fact that "eventually it will reach an even number, because no binary expansion of all 1s exist" do the work? I feel it lacks something, hence the question.
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:07










  • $begingroup$
    It will eventually reach an even number simply because $lfloor 1 / 2 rfloor = 0$ and $0$ is even.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:08











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3043294%2fsolve-for-lambdax-mathbb-n-to-mathbb-n-given-two-cases%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









2












$begingroup$

Hint: Does the base-2 expansion of the input $x$ tell you anything?



Solution:
The base-2 expansion of the input $x$ has $m$ trailing 1s: $$x equiv ( d_1 ldots d_n 0 underbrace{1 cdots 1}_m )_2.$$ Note that $x$ is even if and only if $m = 0$. If $m geq 1$, the operation $lfloor x / 2 rfloor$ is equivalent to removing the last trailing 1 from the above expansion. Therefore, begin{multline*}lambda(x) = 2^m lambda( (d_1 ldots d_n 0)_2 ) = 2^m left[(d_1 ldots d_n 0)_2 + 1 right] \ = 2^m (d_1 ldots d_n 1)_2 = (d_1 ldots d_n 1 underbrace{0 cdots 0}_m)_2 = x + 1.end{multline*}






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Exactly. But how can it be proved that $x+1$ is the only solution for $lambda$?
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:02






  • 1




    $begingroup$
    Try looking at the base-2 expansion of $23$, $lfloor 23 / 2 rfloor = 11$, $lfloor 11 / 2 rfloor = 5$, and $lfloor 5 / 2 rfloor = 2$. You should be able to spot a pattern that you can generalize from.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:05












  • $begingroup$
    Does the fact that "eventually it will reach an even number, because no binary expansion of all 1s exist" do the work? I feel it lacks something, hence the question.
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:07










  • $begingroup$
    It will eventually reach an even number simply because $lfloor 1 / 2 rfloor = 0$ and $0$ is even.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:08
















2












$begingroup$

Hint: Does the base-2 expansion of the input $x$ tell you anything?



Solution:
The base-2 expansion of the input $x$ has $m$ trailing 1s: $$x equiv ( d_1 ldots d_n 0 underbrace{1 cdots 1}_m )_2.$$ Note that $x$ is even if and only if $m = 0$. If $m geq 1$, the operation $lfloor x / 2 rfloor$ is equivalent to removing the last trailing 1 from the above expansion. Therefore, begin{multline*}lambda(x) = 2^m lambda( (d_1 ldots d_n 0)_2 ) = 2^m left[(d_1 ldots d_n 0)_2 + 1 right] \ = 2^m (d_1 ldots d_n 1)_2 = (d_1 ldots d_n 1 underbrace{0 cdots 0}_m)_2 = x + 1.end{multline*}






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Exactly. But how can it be proved that $x+1$ is the only solution for $lambda$?
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:02






  • 1




    $begingroup$
    Try looking at the base-2 expansion of $23$, $lfloor 23 / 2 rfloor = 11$, $lfloor 11 / 2 rfloor = 5$, and $lfloor 5 / 2 rfloor = 2$. You should be able to spot a pattern that you can generalize from.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:05












  • $begingroup$
    Does the fact that "eventually it will reach an even number, because no binary expansion of all 1s exist" do the work? I feel it lacks something, hence the question.
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:07










  • $begingroup$
    It will eventually reach an even number simply because $lfloor 1 / 2 rfloor = 0$ and $0$ is even.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:08














2












2








2





$begingroup$

Hint: Does the base-2 expansion of the input $x$ tell you anything?



Solution:
The base-2 expansion of the input $x$ has $m$ trailing 1s: $$x equiv ( d_1 ldots d_n 0 underbrace{1 cdots 1}_m )_2.$$ Note that $x$ is even if and only if $m = 0$. If $m geq 1$, the operation $lfloor x / 2 rfloor$ is equivalent to removing the last trailing 1 from the above expansion. Therefore, begin{multline*}lambda(x) = 2^m lambda( (d_1 ldots d_n 0)_2 ) = 2^m left[(d_1 ldots d_n 0)_2 + 1 right] \ = 2^m (d_1 ldots d_n 1)_2 = (d_1 ldots d_n 1 underbrace{0 cdots 0}_m)_2 = x + 1.end{multline*}






share|cite|improve this answer











$endgroup$



Hint: Does the base-2 expansion of the input $x$ tell you anything?



Solution:
The base-2 expansion of the input $x$ has $m$ trailing 1s: $$x equiv ( d_1 ldots d_n 0 underbrace{1 cdots 1}_m )_2.$$ Note that $x$ is even if and only if $m = 0$. If $m geq 1$, the operation $lfloor x / 2 rfloor$ is equivalent to removing the last trailing 1 from the above expansion. Therefore, begin{multline*}lambda(x) = 2^m lambda( (d_1 ldots d_n 0)_2 ) = 2^m left[(d_1 ldots d_n 0)_2 + 1 right] \ = 2^m (d_1 ldots d_n 1)_2 = (d_1 ldots d_n 1 underbrace{0 cdots 0}_m)_2 = x + 1.end{multline*}







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Dec 16 '18 at 23:26

























answered Dec 16 '18 at 23:01









parsiadparsiad

18.3k32453




18.3k32453












  • $begingroup$
    Exactly. But how can it be proved that $x+1$ is the only solution for $lambda$?
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:02






  • 1




    $begingroup$
    Try looking at the base-2 expansion of $23$, $lfloor 23 / 2 rfloor = 11$, $lfloor 11 / 2 rfloor = 5$, and $lfloor 5 / 2 rfloor = 2$. You should be able to spot a pattern that you can generalize from.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:05












  • $begingroup$
    Does the fact that "eventually it will reach an even number, because no binary expansion of all 1s exist" do the work? I feel it lacks something, hence the question.
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:07










  • $begingroup$
    It will eventually reach an even number simply because $lfloor 1 / 2 rfloor = 0$ and $0$ is even.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:08


















  • $begingroup$
    Exactly. But how can it be proved that $x+1$ is the only solution for $lambda$?
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:02






  • 1




    $begingroup$
    Try looking at the base-2 expansion of $23$, $lfloor 23 / 2 rfloor = 11$, $lfloor 11 / 2 rfloor = 5$, and $lfloor 5 / 2 rfloor = 2$. You should be able to spot a pattern that you can generalize from.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:05












  • $begingroup$
    Does the fact that "eventually it will reach an even number, because no binary expansion of all 1s exist" do the work? I feel it lacks something, hence the question.
    $endgroup$
    – Garmekain
    Dec 16 '18 at 23:07










  • $begingroup$
    It will eventually reach an even number simply because $lfloor 1 / 2 rfloor = 0$ and $0$ is even.
    $endgroup$
    – parsiad
    Dec 16 '18 at 23:08
















$begingroup$
Exactly. But how can it be proved that $x+1$ is the only solution for $lambda$?
$endgroup$
– Garmekain
Dec 16 '18 at 23:02




$begingroup$
Exactly. But how can it be proved that $x+1$ is the only solution for $lambda$?
$endgroup$
– Garmekain
Dec 16 '18 at 23:02




1




1




$begingroup$
Try looking at the base-2 expansion of $23$, $lfloor 23 / 2 rfloor = 11$, $lfloor 11 / 2 rfloor = 5$, and $lfloor 5 / 2 rfloor = 2$. You should be able to spot a pattern that you can generalize from.
$endgroup$
– parsiad
Dec 16 '18 at 23:05






$begingroup$
Try looking at the base-2 expansion of $23$, $lfloor 23 / 2 rfloor = 11$, $lfloor 11 / 2 rfloor = 5$, and $lfloor 5 / 2 rfloor = 2$. You should be able to spot a pattern that you can generalize from.
$endgroup$
– parsiad
Dec 16 '18 at 23:05














$begingroup$
Does the fact that "eventually it will reach an even number, because no binary expansion of all 1s exist" do the work? I feel it lacks something, hence the question.
$endgroup$
– Garmekain
Dec 16 '18 at 23:07




$begingroup$
Does the fact that "eventually it will reach an even number, because no binary expansion of all 1s exist" do the work? I feel it lacks something, hence the question.
$endgroup$
– Garmekain
Dec 16 '18 at 23:07












$begingroup$
It will eventually reach an even number simply because $lfloor 1 / 2 rfloor = 0$ and $0$ is even.
$endgroup$
– parsiad
Dec 16 '18 at 23:08




$begingroup$
It will eventually reach an even number simply because $lfloor 1 / 2 rfloor = 0$ and $0$ is even.
$endgroup$
– parsiad
Dec 16 '18 at 23:08


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3043294%2fsolve-for-lambdax-mathbb-n-to-mathbb-n-given-two-cases%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Plaza Victoria

Puebla de Zaragoza

Musa