How can I write a function for $c$ in terms of $a$ and $b$? [closed]
$begingroup$
For $a,bneq 0$, let $c$ be
$1$ if $a$ and $b$ both are positive.
$-1$ if any one of $a$ or $b$ is negative or both are negative.
How can I write a function for $c$ in terms of $a$ and $b$?
algebra-precalculus functions
$endgroup$
closed as unclear what you're asking by jameselmore, GoodDeeds, BigbearZzz, Rebellos, T. Bongers Dec 13 '18 at 19:40
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
|
show 4 more comments
$begingroup$
For $a,bneq 0$, let $c$ be
$1$ if $a$ and $b$ both are positive.
$-1$ if any one of $a$ or $b$ is negative or both are negative.
How can I write a function for $c$ in terms of $a$ and $b$?
algebra-precalculus functions
$endgroup$
closed as unclear what you're asking by jameselmore, GoodDeeds, BigbearZzz, Rebellos, T. Bongers Dec 13 '18 at 19:40
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
$begingroup$
What about if a and b are both negative? The "or" is exclusive?
$endgroup$
– gimusi
Dec 13 '18 at 15:29
1
$begingroup$
How about $$c(a,b) = begin{cases} 1 & a text{ and } b text{ both are positive}\ -1 & text{any one out of } a text{ or } b text{ is negative} end{cases}$$ since it is rather unclear what you are trying to ask
$endgroup$
– glowstonetrees
Dec 13 '18 at 15:30
2
$begingroup$
You have already described it. What do you mean by "finding out what $c$ is"?
$endgroup$
– dbx
Dec 13 '18 at 15:40
1
$begingroup$
You might try $c = min(text{sign}(a),text{sign}(b))$. You didn't say what $c$ is if $a$ or $b$ is $0$ and neither is negative, though.
$endgroup$
– Robert Israel
Dec 13 '18 at 15:52
1
$begingroup$
As @dbx said, you've already defined $c$ in terms of $a$ and $b$. What more do you mean by "finding out what $c$ is"?
$endgroup$
– Andreas Blass
Dec 13 '18 at 15:52
|
show 4 more comments
$begingroup$
For $a,bneq 0$, let $c$ be
$1$ if $a$ and $b$ both are positive.
$-1$ if any one of $a$ or $b$ is negative or both are negative.
How can I write a function for $c$ in terms of $a$ and $b$?
algebra-precalculus functions
$endgroup$
For $a,bneq 0$, let $c$ be
$1$ if $a$ and $b$ both are positive.
$-1$ if any one of $a$ or $b$ is negative or both are negative.
How can I write a function for $c$ in terms of $a$ and $b$?
algebra-precalculus functions
algebra-precalculus functions
edited Dec 13 '18 at 20:20
user587192
asked Dec 13 '18 at 15:23
Mrigank Shekhar PathakMrigank Shekhar Pathak
52229
52229
closed as unclear what you're asking by jameselmore, GoodDeeds, BigbearZzz, Rebellos, T. Bongers Dec 13 '18 at 19:40
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by jameselmore, GoodDeeds, BigbearZzz, Rebellos, T. Bongers Dec 13 '18 at 19:40
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
$begingroup$
What about if a and b are both negative? The "or" is exclusive?
$endgroup$
– gimusi
Dec 13 '18 at 15:29
1
$begingroup$
How about $$c(a,b) = begin{cases} 1 & a text{ and } b text{ both are positive}\ -1 & text{any one out of } a text{ or } b text{ is negative} end{cases}$$ since it is rather unclear what you are trying to ask
$endgroup$
– glowstonetrees
Dec 13 '18 at 15:30
2
$begingroup$
You have already described it. What do you mean by "finding out what $c$ is"?
$endgroup$
– dbx
Dec 13 '18 at 15:40
1
$begingroup$
You might try $c = min(text{sign}(a),text{sign}(b))$. You didn't say what $c$ is if $a$ or $b$ is $0$ and neither is negative, though.
$endgroup$
– Robert Israel
Dec 13 '18 at 15:52
1
$begingroup$
As @dbx said, you've already defined $c$ in terms of $a$ and $b$. What more do you mean by "finding out what $c$ is"?
$endgroup$
– Andreas Blass
Dec 13 '18 at 15:52
|
show 4 more comments
1
$begingroup$
What about if a and b are both negative? The "or" is exclusive?
$endgroup$
– gimusi
Dec 13 '18 at 15:29
1
$begingroup$
How about $$c(a,b) = begin{cases} 1 & a text{ and } b text{ both are positive}\ -1 & text{any one out of } a text{ or } b text{ is negative} end{cases}$$ since it is rather unclear what you are trying to ask
$endgroup$
– glowstonetrees
Dec 13 '18 at 15:30
2
$begingroup$
You have already described it. What do you mean by "finding out what $c$ is"?
$endgroup$
– dbx
Dec 13 '18 at 15:40
1
$begingroup$
You might try $c = min(text{sign}(a),text{sign}(b))$. You didn't say what $c$ is if $a$ or $b$ is $0$ and neither is negative, though.
$endgroup$
– Robert Israel
Dec 13 '18 at 15:52
1
$begingroup$
As @dbx said, you've already defined $c$ in terms of $a$ and $b$. What more do you mean by "finding out what $c$ is"?
$endgroup$
– Andreas Blass
Dec 13 '18 at 15:52
1
1
$begingroup$
What about if a and b are both negative? The "or" is exclusive?
$endgroup$
– gimusi
Dec 13 '18 at 15:29
$begingroup$
What about if a and b are both negative? The "or" is exclusive?
$endgroup$
– gimusi
Dec 13 '18 at 15:29
1
1
$begingroup$
How about $$c(a,b) = begin{cases} 1 & a text{ and } b text{ both are positive}\ -1 & text{any one out of } a text{ or } b text{ is negative} end{cases}$$ since it is rather unclear what you are trying to ask
$endgroup$
– glowstonetrees
Dec 13 '18 at 15:30
$begingroup$
How about $$c(a,b) = begin{cases} 1 & a text{ and } b text{ both are positive}\ -1 & text{any one out of } a text{ or } b text{ is negative} end{cases}$$ since it is rather unclear what you are trying to ask
$endgroup$
– glowstonetrees
Dec 13 '18 at 15:30
2
2
$begingroup$
You have already described it. What do you mean by "finding out what $c$ is"?
$endgroup$
– dbx
Dec 13 '18 at 15:40
$begingroup$
You have already described it. What do you mean by "finding out what $c$ is"?
$endgroup$
– dbx
Dec 13 '18 at 15:40
1
1
$begingroup$
You might try $c = min(text{sign}(a),text{sign}(b))$. You didn't say what $c$ is if $a$ or $b$ is $0$ and neither is negative, though.
$endgroup$
– Robert Israel
Dec 13 '18 at 15:52
$begingroup$
You might try $c = min(text{sign}(a),text{sign}(b))$. You didn't say what $c$ is if $a$ or $b$ is $0$ and neither is negative, though.
$endgroup$
– Robert Israel
Dec 13 '18 at 15:52
1
1
$begingroup$
As @dbx said, you've already defined $c$ in terms of $a$ and $b$. What more do you mean by "finding out what $c$ is"?
$endgroup$
– Andreas Blass
Dec 13 '18 at 15:52
$begingroup$
As @dbx said, you've already defined $c$ in terms of $a$ and $b$. What more do you mean by "finding out what $c$ is"?
$endgroup$
– Andreas Blass
Dec 13 '18 at 15:52
|
show 4 more comments
3 Answers
3
active
oldest
votes
$begingroup$
Aside from the problem with $0$ you can write $$c=minleft(frac a{|a|},frac b{|b|}right)$$ but that is really no different from the case statement you rejected in the comments. What is wrong with definition by cases?
$endgroup$
add a comment |
$begingroup$
We can consider for $abneq 0$ and assuming $(-1)^{-1}=-1$ and $0^0=1$
$$c=-left(frac{-a|b|-|a|b}{2|ab|}right)^{left(frac{-a|b|-|a|b}{2|ab|}right)}$$
$endgroup$
add a comment |
$begingroup$
We can use $f(x) = frac{|x|}{x}$ to map positive, non-zero numbers to 1 and negative numbers to -1. From here, $c = f(a)cdot f(b)$ works for three of the four cases. To make it work for the last case, we hope to change 1 to negative 1 if a and b both negative and no change otherwise. Just multiply by $(frac{f(a)+f(b)}{2})^{frac{f(a)+f(b)}{2}}$.
$$c = frac{|a|}{a}cdot frac{|b|}{b} cdot bigg(frac{ frac{|a|}{a}+ frac{|b|}{b} }{2}bigg)^{ big(frac{frac{|a|}{a}+frac{|b|}{b}}{2}big)}$$
$endgroup$
1
$begingroup$
You gave me an idea to deal with the case a and b with different sign!
$endgroup$
– gimusi
Dec 13 '18 at 17:23
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Aside from the problem with $0$ you can write $$c=minleft(frac a{|a|},frac b{|b|}right)$$ but that is really no different from the case statement you rejected in the comments. What is wrong with definition by cases?
$endgroup$
add a comment |
$begingroup$
Aside from the problem with $0$ you can write $$c=minleft(frac a{|a|},frac b{|b|}right)$$ but that is really no different from the case statement you rejected in the comments. What is wrong with definition by cases?
$endgroup$
add a comment |
$begingroup$
Aside from the problem with $0$ you can write $$c=minleft(frac a{|a|},frac b{|b|}right)$$ but that is really no different from the case statement you rejected in the comments. What is wrong with definition by cases?
$endgroup$
Aside from the problem with $0$ you can write $$c=minleft(frac a{|a|},frac b{|b|}right)$$ but that is really no different from the case statement you rejected in the comments. What is wrong with definition by cases?
answered Dec 13 '18 at 16:56
Ross MillikanRoss Millikan
297k23198371
297k23198371
add a comment |
add a comment |
$begingroup$
We can consider for $abneq 0$ and assuming $(-1)^{-1}=-1$ and $0^0=1$
$$c=-left(frac{-a|b|-|a|b}{2|ab|}right)^{left(frac{-a|b|-|a|b}{2|ab|}right)}$$
$endgroup$
add a comment |
$begingroup$
We can consider for $abneq 0$ and assuming $(-1)^{-1}=-1$ and $0^0=1$
$$c=-left(frac{-a|b|-|a|b}{2|ab|}right)^{left(frac{-a|b|-|a|b}{2|ab|}right)}$$
$endgroup$
add a comment |
$begingroup$
We can consider for $abneq 0$ and assuming $(-1)^{-1}=-1$ and $0^0=1$
$$c=-left(frac{-a|b|-|a|b}{2|ab|}right)^{left(frac{-a|b|-|a|b}{2|ab|}right)}$$
$endgroup$
We can consider for $abneq 0$ and assuming $(-1)^{-1}=-1$ and $0^0=1$
$$c=-left(frac{-a|b|-|a|b}{2|ab|}right)^{left(frac{-a|b|-|a|b}{2|ab|}right)}$$
edited Dec 13 '18 at 17:20
answered Dec 13 '18 at 17:11
gimusigimusi
92.9k84494
92.9k84494
add a comment |
add a comment |
$begingroup$
We can use $f(x) = frac{|x|}{x}$ to map positive, non-zero numbers to 1 and negative numbers to -1. From here, $c = f(a)cdot f(b)$ works for three of the four cases. To make it work for the last case, we hope to change 1 to negative 1 if a and b both negative and no change otherwise. Just multiply by $(frac{f(a)+f(b)}{2})^{frac{f(a)+f(b)}{2}}$.
$$c = frac{|a|}{a}cdot frac{|b|}{b} cdot bigg(frac{ frac{|a|}{a}+ frac{|b|}{b} }{2}bigg)^{ big(frac{frac{|a|}{a}+frac{|b|}{b}}{2}big)}$$
$endgroup$
1
$begingroup$
You gave me an idea to deal with the case a and b with different sign!
$endgroup$
– gimusi
Dec 13 '18 at 17:23
add a comment |
$begingroup$
We can use $f(x) = frac{|x|}{x}$ to map positive, non-zero numbers to 1 and negative numbers to -1. From here, $c = f(a)cdot f(b)$ works for three of the four cases. To make it work for the last case, we hope to change 1 to negative 1 if a and b both negative and no change otherwise. Just multiply by $(frac{f(a)+f(b)}{2})^{frac{f(a)+f(b)}{2}}$.
$$c = frac{|a|}{a}cdot frac{|b|}{b} cdot bigg(frac{ frac{|a|}{a}+ frac{|b|}{b} }{2}bigg)^{ big(frac{frac{|a|}{a}+frac{|b|}{b}}{2}big)}$$
$endgroup$
1
$begingroup$
You gave me an idea to deal with the case a and b with different sign!
$endgroup$
– gimusi
Dec 13 '18 at 17:23
add a comment |
$begingroup$
We can use $f(x) = frac{|x|}{x}$ to map positive, non-zero numbers to 1 and negative numbers to -1. From here, $c = f(a)cdot f(b)$ works for three of the four cases. To make it work for the last case, we hope to change 1 to negative 1 if a and b both negative and no change otherwise. Just multiply by $(frac{f(a)+f(b)}{2})^{frac{f(a)+f(b)}{2}}$.
$$c = frac{|a|}{a}cdot frac{|b|}{b} cdot bigg(frac{ frac{|a|}{a}+ frac{|b|}{b} }{2}bigg)^{ big(frac{frac{|a|}{a}+frac{|b|}{b}}{2}big)}$$
$endgroup$
We can use $f(x) = frac{|x|}{x}$ to map positive, non-zero numbers to 1 and negative numbers to -1. From here, $c = f(a)cdot f(b)$ works for three of the four cases. To make it work for the last case, we hope to change 1 to negative 1 if a and b both negative and no change otherwise. Just multiply by $(frac{f(a)+f(b)}{2})^{frac{f(a)+f(b)}{2}}$.
$$c = frac{|a|}{a}cdot frac{|b|}{b} cdot bigg(frac{ frac{|a|}{a}+ frac{|b|}{b} }{2}bigg)^{ big(frac{frac{|a|}{a}+frac{|b|}{b}}{2}big)}$$
edited Dec 13 '18 at 17:23
answered Dec 13 '18 at 17:15
David DiazDavid Diaz
979420
979420
1
$begingroup$
You gave me an idea to deal with the case a and b with different sign!
$endgroup$
– gimusi
Dec 13 '18 at 17:23
add a comment |
1
$begingroup$
You gave me an idea to deal with the case a and b with different sign!
$endgroup$
– gimusi
Dec 13 '18 at 17:23
1
1
$begingroup$
You gave me an idea to deal with the case a and b with different sign!
$endgroup$
– gimusi
Dec 13 '18 at 17:23
$begingroup$
You gave me an idea to deal with the case a and b with different sign!
$endgroup$
– gimusi
Dec 13 '18 at 17:23
add a comment |
1
$begingroup$
What about if a and b are both negative? The "or" is exclusive?
$endgroup$
– gimusi
Dec 13 '18 at 15:29
1
$begingroup$
How about $$c(a,b) = begin{cases} 1 & a text{ and } b text{ both are positive}\ -1 & text{any one out of } a text{ or } b text{ is negative} end{cases}$$ since it is rather unclear what you are trying to ask
$endgroup$
– glowstonetrees
Dec 13 '18 at 15:30
2
$begingroup$
You have already described it. What do you mean by "finding out what $c$ is"?
$endgroup$
– dbx
Dec 13 '18 at 15:40
1
$begingroup$
You might try $c = min(text{sign}(a),text{sign}(b))$. You didn't say what $c$ is if $a$ or $b$ is $0$ and neither is negative, though.
$endgroup$
– Robert Israel
Dec 13 '18 at 15:52
1
$begingroup$
As @dbx said, you've already defined $c$ in terms of $a$ and $b$. What more do you mean by "finding out what $c$ is"?
$endgroup$
– Andreas Blass
Dec 13 '18 at 15:52