×

Hello! Socratic's Terms of Service and Privacy Policy have been updated, which will be automatically effective on October 6, 2018. Please contact hello@socratic.com with any questions.

Math formatting "Pro Tips" edition: Definition by cases! - "?"

2 Answers
Apr 30, 2015

I've (finally) found a way to write definitions by cases for functions.

The syntax looks like this

hashtag { (expression 1, "case 1"), (expression 2, "case 2"), (expression 3, "case 3") ... (expression n, "case n") :} hashtag

Here's an example

  • Without the hashtags

f(x) = { (x^2, ", if x is even"), (2x + 1, ", if x is odd") :}

  • With the hashtags

#f(x) = { (x^2, ", if x is even"), (2x + 1, ", if x is odd") :}#

Aparently, if you use #":}"# at the end of the syntax, the second bracket will no longer be visible.

However, if you want the first bracket removed, but still keep this format, you'll have to write #"{:"# for the first bracket and #":}}"# for the second

  • Without the hashtags

{: ("if x is > 0, ", x^2), ("if x is < 0, ", 2x+1) :}} = f(x)

  • With the hashtags

#{: ("if x is > 0, ", x^2), ("if x is < 0, ", 2x+1) :}} = f(x)#

This could also be used for absolute values equations and stuff like that

  • Without the hashtags

|x + 2| = { (x +2, ", if x + 2" >= "0"), (-x-2, ", if x + 2 < 0") :}

  • With the hashtags

#|x + 2| = { (x +2, ", if x + 2" >= "0"), (-x-2, ", if x + 2 < 0") :}#

Jun 18, 2015

Answer:

This is just a practice answer.

Explanation:

So, the synthax for writing matrices looks iooks like this

  • Without the hashtags

( (1,1,1), (2,2,2), (3,3,3) )

  • With the hashtags

#( (1,1,1), (2,2,2), (3,3,3) )#

Basically, you group the rows by using parantheses and you write them one after the other. Check out more examples of matrices here:

http://socratic.org/questions/how-to-write-matrices-on-socratic#141468

For piecewise functions, you can write

  • Without the hashtags

{ (2x+2, ", x">="0"), (x^2, ", x<0") :}

  • With the hashtags

#{ (2x+2, ", x">="0"), (x^2, ", x<0") :}#

The trick here is to write #{# as the first bracket and #:}# as the end bracket. Once again, the rows are grouped with paratheses. Check out more examples here:

http://socratic.org/questions/i-ve-found-another-syntax-useful-for-math-answers