I have a simple function f(x)=(2x+1)*2^y . Is there a way to rewrite it so that x and y are always even or always odd but never even and odd?
F.e. x is not allowed to be odd if y is even and x is not allowed to be even if y is odd. But if y is even and x is even than everything is cool, same when y is odd and x is odd.
Like, I want all numbers 2x2y and (2x+1)(2y+1) but in one function.
>>8720666
y=2u
>>8720666
so what you are trying to figure out if y is even to x or odd? right? my english is not the best
>>8720666
I need more context because your question makes no sense.
What do you mean by "not allow"? What do you want your function to output when one is odd and the other is even?
That's a strange way to formulate your need to get a cock up your ass.
Have you considered psychotherapy ?
>>8720666
>f(x)=(2x+1)*2^y
Shouldn't it be [math]f(x,y) = (2x + 1)\cdot 2^{y}[/math]? It looks like the function depends on both x and y here.
>>8720723
yeah looks a little weird when i play with it. tell me if i did something wrong. not OP
>>8720731
That's not how exponents work
>>8720737
how would it work then?
If you want both x and y to always be even substitute them for 2x and 2y respectively
If you want them to always be odd substitute them for 2x+1 and 2y+1 respectively
>>8720741
2x * 2^y = (2^(y+1))(x)
>>8720747
can you show me how you got there step by step? i saw something like that when i googled it but i never did it like this in school. im just interested
>>8720666
{2x+1*2^y|odd(x)=odd(y)}
>>8720666
For x and y to always be both even or both odd, their sum must be even.
x+y=2k
y=2k-x
But that's not a function as far as I know, if you only have integers
sorry guys I was afk as fuck
>>8720704
kinda , yes
>>8720713
the input should be (odd,odd) or (even,even) for (x,y)
>>8720723
this is correct I fucked up sry
>>8720731
yeah it should be f(x,y) sry
>>8720756
I cant use if/else nor can I use 2 functions
>>8721112
then how do I do it?
could it be that i need to split the function into 2?
like
f(x,y)=(2(2x)+1)*2^(2y)
and
f(x,y)=(2(2x+1)+1)*2^(2y+1)
? That would be extremly retarded because I need ONE function for a proof.
>>8721318
You still didn't answer my question, you just repeated what you said in the op.
Functions aren't defined by their inputs, they are defined by their outputs. The only way you can restrict the inputs of a function is by literally stating the domain of the function to be that.
If both of them are odd/even then their sum is even. You can represent y as 2k - x if that's what you mean
If x and y are both even or both odd, their difference is always
even, as is their sum. If x and y are different parity, their
sum and difference will be odd. Thus we may set
(x-y)=2*u (even)
(x+y)=2*v (even)
so then
x=u+v
y=v-u
and
(2x+1)*2^y = (2(u+v)+1)*2^(v-u).
So work with g(u,v)=(2(u+v)+1)*2^(v-u).
>>8721318
No you dip, just replace every y with 2k-x and state that x,k are integers. This is a new function, f(x,k).
>>8721543
this doesnt do what I want
>>8721515
this doesnt work either
>>8721491
>>Functions aren't defined by their inputs
The input is N* and then I only want specific numbers out of N* - like I have some x and I only want even numbers as an input so have to replace every x with 2x, whats the problem?
you're literally all gay
>>8720688
was getting caught part of your plan?
>>8720666
to see if i understand what you're saying: essentially what you want is a bijection from NxN to the set
[math] \{(x,y)\in NxN: x=y mod 2\} [/math]
is this right?
Make the domain [math]\{(x,y) | x \equiv y \mod{2}, x,y \in \mathbb{Z} \}[/math]?
Is this what you want?
>>8721903
Your solution by changing all x to 2x is really just applying a mapping from N* to the evens, then applying your function.
So what you are asking for is impossible. You're asking how to map N* to both the odds AND the evens at the same time before applying your function. That doesn't make sense. For example, if x=1 and y=2, do you want to make x even or y odd?
Now I'll propose some alternatives, tell me if any of these work:
You can map all outputs of entries you do not want to 0, then only consider nonzero outputs of your function. You can also just state the only inputs allowed are of the desired form. In fact you are already doing this by saying the inputs are positive integers. Finally, you can map all entries you do not want to be undefined, and only take the defined outputs.
>>8722968
>So what you are asking for is impossible
kek I found a solution and it wasnt even that hard to find
>>8722977
Share it, because what you are asking for literally makes no sense.
>>8722983
i'll replace
y with (2y+((1/2)(1-(-1)^x))) and x stays just x
>>8723000
Ah, I see now.
Clever solution.