Function Challenge

For the function listed below, try expressing them in a single formula.

Example :

f(x)={xif x0xif x<0 f(x) = \begin{cases} -x & \quad \text{if } x \geq 0\\ x & \quad \text{if } x<0\\ \end{cases}

Answer : f(x)=xf(x) = -|x|

Challenge 1 :

f(x)={1if x<01if x>0 f(x) = \begin{cases} 1 & \quad \text{if } x < 0\\ -1 & \quad \text{if } x>0\\ \end{cases}

Challenge 2 :

f(x)={0if x0xif x>0 f(x) = \begin{cases} 0 & \quad \text{if } x\leq 0\\ x & \quad \text{if } x>0\\ \end{cases}

Challenge 3 :

f(x,y)={xyif x>yx+yif x<y f(x,y) = \begin{cases} x-y & \quad \text{if } x > y\\ x+y & \quad \text{if } x < y\\ \end{cases}

Comment your answer and vote up good functions!

Note by Christopher Boo
3 years, 9 months ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Sort by:

Top Newest

1)xx-\dfrac{x}{|x|} 2)x2+x2\left|\dfrac{x}{2}\right|+\dfrac{x}{2} 3)(xy)(x+y)(x+xyyxy)\dfrac{(x-y)(x+y)}{\left(x+\dfrac{|x-y|y}{x-y}\right)}

Aareyan Manzoor - 3 years, 9 months ago

Log in to reply

  1. f1(x)=xxf_1(x)=-\frac {|x|}{x}

  2. f2(x)=x+x2f_2(x)=\frac {|x|+x}{2}

  3. We can find a solution by using the solutions for challenge 1 and 2:

I don't know how to type arrays so let 1,21,2 denote the conditions yx<0,yx>0y-x<0, y-x>0 respectively.

Note that f2(yx)+x=1.x,2.yf_2(y-x)+x=1.x, 2.y and f2(yx)y=1.y,2.xf_2(y-x)-y=1.-y, 2.-x.

Further, f1(yx)(f2(yx)y)=1.y,2.xf_1(y-x)(f_2(y-x)-y)=1.-y, 2.x

Hence f(x)=f2(yx)+x+f1(yx)(f2(yx)y)=1.xy,2.x+yf(x)=f_2(y-x)+x+f_1(y-x)(f_2(y-x)-y)=1.x-y, 2.x+y

Another way is by considering 1+f1(yx)2=1.1,2.0,1f1(yx)2=1.0,2.1\frac {1+f_1(y-x)}{2}=1.1, 2.0, \frac {1-f_1(y-x)}{2}=1.0, 2.1.

Thus, f(x)=(xy)1+f1(yx)2+(x+y)1f1(yx)2f(x)=(x-y)\frac {1+f_1(y-x)}{2}+(x+y)\frac {1-f_1(y-x)}{2}

Xuming Liang - 3 years, 9 months ago

Log in to reply

For the first function, f(x)=1{xx<0}1{xx>0}f(x) = 1_{\{x|x<0\}} - 1_{\{x|x>0\}} where f:R{0}Rf : \mathbb{R} \setminus \{0\} \to \mathbb{R}. Because 1S1_S is the characteristic function that returns 11 if the argument is in SS and 00 otherwise.

If you want me to nitpick even more, those given aren't functions since you don't specify the domain (and the range, but the range usually can be inferred assuming it fits the whole domain). If I assume the domain of the first function is {1}\{1\}, then my "formula" can be as simple as f(x)=1f(x) = -1 (because it only needs to work for the single number x=1x = 1 in the domain).

A more interesting question is why you want to look specifically for just a single formula, and not just leave the function piecewise which is much easier to understand compared to the single formula forms?

Ivan Koswara - 3 years, 9 months ago

Log in to reply

Compute the value of

sin10sin30sin50sin70\sin 10^\circ \sin 30^\circ \sin 50^\circ \sin 70^\circ

without using a calculator.

Why shouldn't we use a calculator when we can? Isn't using a calculator faster and is less likely to have errors?

Christopher Boo - 3 years, 9 months ago

Log in to reply

You can't use calculator there because the result is rational. A calculator might round/truncate the result midway. I did throw it to WolframAlpha anyway, though.

Ivan Koswara - 3 years, 9 months ago

Log in to reply

@Ivan Koswara @Ivan Koswara, imagine you are solving a hard equation. yo just spend a huge time on it and are feeling proud of what you did! You want to show other people this cool eqn but when you show this to yor classmates, who suck at maths, say "waste of time, i solved it in a second by putting it in wolfram alpha. i am smarter then you."

But some stuff need analytical approach despite being easily solvable by numerical/computational approach. please think about this.

the "imagine" is taken from real life!

Aareyan Manzoor - 3 years, 9 months ago

Log in to reply

×

Problem Loading...

Note Loading...

Set Loading...