Message Boards Message Boards

2
|
8244 Views
|
15 Replies
|
22 Total Likes
View groups...
Share
Share this post:

Conditional Equation in TraditionalForm

Posted 10 years ago

How does one type a conditional equation in traditional form? By "conditional equation" I mean an equation that has a certain output depending on a given input. Forgive my ignorance - that's probably not the correct term.

Thanks,

Dean Sparrow, Physics Student

POSTED BY: Dean Sparrow
15 Replies

Dean, I suspect that most of what's in the latest version is in Wikipedia.

POSTED BY: Frank Kampas

Thanks, Marco - problem solved.

Frank, this latest edition has swollen to 1200 pages. Amazon shows a pared-down version entitled Essential Methods for Physicists.

Best,

Dean

POSTED BY: Dean Sparrow

BTW using the classroom assistant palette under Typesetting in the 5th row 4th entry you also find the standard brackets you need to do these statements. The result is this:

enter image description here

This looks like standard typesetting and works just fine:

v[2^-# &]

(*convergent*)

Cheers,

Marco

If you convert this to standard form it gives you yet another way of writing the same thing:

v[a_] := Piecewise[{
    {"convergent", Limit[a[n + 1]/a[n], n -> \[Infinity]] < 1}, 
    {"divergent", Limit[a[n + 1]/a[n], n -> \[Infinity]] > 1}, 
    {"indeterminate", Limit[a[n + 1]/a[n], n -> \[Infinity]] == 1}}]
POSTED BY: Marco Thiel

It's equation 5.16 in my copy of Arfken. The first edition has about 650 pages. How long is the seventh edition?

POSTED BY: Frank Kampas

Hi,

I am not sure whether I am completely off topic here, because I ignore the part of "TraditionalForm", because I don't like typing like that, and it's not always quite clear. But if you want to implement the D'Alembert ratio test

f[a_] := Which[Limit[a[n + 1]/a[n], n -> Infinity] < 1, "convergent", Limit[a[n + 1]/a[n], n -> Infinity] > 1, "divergent", Limit[a[n+1]/a[n ], n -> Infinity] == 1, "indeterminate"];

does the trick. If you input a given sequence it tells you whether it converges or not:

c[n_] := 1/n;
f[c]

(*Indeterminate*)

Alternatively you can use pure functions:

f[1/#&]

(*Indeterminate*)

You can also use built in functions:

f[Fibonacci]

(*divergent*)

Of course, you also can see convergent ones like this one:

f[(1/2)^# &]

(*convergent*)

As I said, I do not like the TraditionalForm a lot, but if you want to see how the function looks you can use:

Which[Limit[a[n + 1]/a[n], n -> Infinity] < 1, "convergent", Limit[a[n + 1]/a[n], n -> Infinity] > 1, "divergent", Limit[a[n+1]/a[n ], n -> Infinity] == 1, "indeterminate"] // TraditionalForm

This gives:

enter image description here

I am aware that this probably does not answer you question, but it does implement the D'Alembert ratio test.

Cheers,

Marco

POSTED BY: Marco Thiel

Don't tell the publisher.

Attachments:
POSTED BY: Dean Sparrow

In words, let a(n) be terms of an infinite series. If, in the limit as n approaches infinity, a(n+1)/a(n) < 1, then the series is convergent. Similarly if the ratio is > 1, then it is divergent. If the ratio = 1 however, then the test is inconclusive.

I just want to type this "pretty", like a textbook.

Thanks.

POSTED BY: Dean Sparrow

My copy of Arfken is the first edition, so you'll need to be a little more specific.

POSTED BY: Frank Kampas

Apologies for the fury of replies to my little question. I've been trying (in vain) to find a picture or link to illustrate my point. The closest I can come is the following:

Suppose I'd like to type the alternate statement of D'Alembert's ratio test (see 1.6 in Mathematical Methods for Physicists by Arfken et al, 7th edition) in traditional form (i.e. the big left curly brace with conditions to the right). How can I do this in Mathematica?

Thanks,

Dean Sparrow

POSTED BY: Dean Sparrow

I think you may have to convert your problem into a system of two equations for RSolve to be able to handle it. Something like x = n/2 for the even numbers and y = (n-1)/2 for the odd numbers.

POSTED BY: Frank Kampas
Posted 10 years ago

Thank you for your answer but this is a function, RSolve expects an equation, so I can not simply plug f into RSolve, do you see what I mean?

POSTED BY: Ezgi Cicek
f[n_?EvenQ] := 1 + f[n/2]; 
f[n_?OddQ] := 1 + f[(n - 1)/2] + f[(n + 1)/2]; f[1] = 1;
POSTED BY: Frank Kampas
Posted 10 years ago

I have a related question. I have the following conditional equation:

f(n) =1+2 f(n/2) when n is even

f(n) = 1+f((n-1)/2)+f((n+1)/2) when n is odd

I want to represent this as a conditional equation to be used in RSolve with f(1)=1. How do I express this in Mathematica? If[cond,e1,e2] doesn't work.

POSTED BY: Ezgi Cicek

I mean an equation that has a certain output depending on a given input

That is normally called a function, not an equation. If you can give an example of what you mean or trying to code, it will make it easier to help you.

POSTED BY: Nasser M. Abbasi

Mathematica has an If function.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract