I have a simple function f(x)=(2x+1)*2^y...

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.

y=2u

so what you are trying to figure out if y is even to x or odd? right? my english is not the best

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 ?

>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.

yeah looks a little weird when i play with it. tell me if i did something wrong. not OP

That's not how exponents work

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

2x * 2^y = (2^(y+1))(x)

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

{2x+1*2^y|odd(x)=odd(y)}

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

kinda , yes

the input should be (odd,odd) or (even,even) for (x,y)

this is correct I fucked up sry

yeah it should be f(x,y) sry

I cant use if/else nor can I use 2 functions

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.

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).

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).

this doesnt do what I want

this doesnt work either

>>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

was getting caught part of your plan?

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?

This looks good

Thats cheating domain is N*xN*

I cant just change the domain

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.

>So what you are asking for is impossible

kek I found a solution and it wasnt even that hard to find

Share it, because what you are asking for literally makes no sense.

i'll replace
y with (2y+((1/2)(1-(-1)^x))) and x stays just x

Ah, I see now.

Clever solution.