Expression that alternates between 0 and 1?
Moderators: gmalivuk, Moderators General, Prelates
Expression that alternates between 0 and 1?
We have to find a closed form equation for a sum in my algebra assignment. I found something that is so friggin' close: It is perfect except that you need to add 1 for odd values of n. The TA hinted that for one question you might have to split it into even and odd cases, and that's what I did, and that's how I'll hand it in since it's due tomorrow. But I'm still curious as to whether there's any way of making it work algebraically, sort of like how you can apply [math](1)^n[/math] to make a sequence alternate sign for example.
I can post the full question if anyone's curious and wants to have a go at it, it was kind of fun to work out although not too difficult (minus the half hour I spent trying to get it to work before I found out you were allowed to split up the cases...)
I can post the full question if anyone's curious and wants to have a go at it, it was kind of fun to work out although not too difficult (minus the half hour I spent trying to get it to work before I found out you were allowed to split up the cases...)
Re: Expression that alternates between 0 and 1?
(1)^n + n modulo 2?
It is basically what you did, true, but it doesn't involve splitting cases...
It is basically what you did, true, but it doesn't involve splitting cases...
Re: Expression that alternates between 0 and 1?
You have an expression which alternates between 1 and 1. Find a function which takes 1 to 0 and 1 to 1.
Jerry Bona wrote:The Axiom of Choice is obviously true; the Well Ordering Principle is obviously false; and who can tell about Zorn's Lemma?

 Posts: 778
 Joined: Mon Aug 11, 2008 10:58 pm UTC
 Location: Palo Alto, CA
Re: Expression that alternates between 0 and 1?
antonfire wrote:You have an expression which alternates between 1 and 1. Find a function which takes 1 to 0 and 1 to 1.
Very much this. There's absolutely no need for splitting cases.
GENERATION 16 + 31i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.
Re: Expression that alternates between 0 and 1?
That would be the Heaviside function, unless there's something similar that I'm unaware of. Heaviside works, but it has cases within it, so technically it's not all that different. Is there some other function I'm not thinking of?
Re: Expression that alternates between 0 and 1?
No, all you need is a function (any function at all!) such that f(1)=0 and f(1)=1
There are several simple functions that do this.
There are several simple functions that do this.
 Indigo is a lie.
Which idiot decided that websites can't go within 4cm of the edge of the screen?
There should be a null word, for the question "Is anybody there?" and to see if microphones are on.

 Posts: 778
 Joined: Mon Aug 11, 2008 10:58 pm UTC
 Location: Palo Alto, CA
Re: Expression that alternates between 0 and 1?
Hint: plot the points (1,0) and (1,1). You're looking for a function that passes through both of them. [imath]f(x) = \frac14(x+1)^2[/imath] is one such function; can you think of a simpler one?
GENERATION 16 + 31i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.

 Posts: 97
 Joined: Sun May 03, 2009 4:27 pm UTC
Re: Expression that alternates between 0 and 1?
I can think of a really, really simple way to change what you've got into what you want, but I'm not sure if you want us to just give you the answer. The hints people have posted above should lead you to it anyway, so I'm going to put what my answer would be into spoilers.
Spoiler:
Re: Expression that alternates between 0 and 1?
Of course it might be nicer to use a continuous periodic function like sin(x)
 Indigo is a lie.
Which idiot decided that websites can't go within 4cm of the edge of the screen?
There should be a null word, for the question "Is anybody there?" and to see if microphones are on.
Re: Expression that alternates between 0 and 1?
Quite simple.
Spoiler:
Re: Expression that alternates between 0 and 1?
i'm curious, what was the question?
Re: Expression that alternates between 0 and 1?
mrmitch wrote:Quite simple.Spoiler:
This is was what I was trying to figure out, and what I'm guessing most people were trying to point me towards. Someone else had found it and I was quite frustrated to have not thought of it. I'm pretty sure it just overcomplicates the question, but hey, maybe someone can make it work.
Here's the question: it was a graded assignment so I didn't want to be too specific at the time:
Find a closed form formula for [math]\sum^n_{i=1}(−1)^i(2i − 1)^2[/math] for n ≥ 1
If anyone can find a single closedform equation for that sum and prove its validity, I would be very interested to see it. It's pretty straightforward to prove for two equations (by showing the odd case produces the even for n+1, and viceversa), which is what I settled for, but I'm sure it's possible with a single equation.
Re: Expression that alternates between 0 and 1?
Nicest I can get it:
Spoiler:
 Indigo is a lie.
Which idiot decided that websites can't go within 4cm of the edge of the screen?
There should be a null word, for the question "Is anybody there?" and to see if microphones are on.
 BlackSails
 Posts: 5315
 Joined: Thu Dec 20, 2007 5:48 am UTC
Re: Expression that alternates between 0 and 1?
Rippy wrote:
If anyone can find a single closedform equation for that sum and prove its validity, I would be very interested to see it. It's pretty straightforward to prove for two equations (by showing the odd case produces the even for n+1, and viceversa), which is what I settled for, but I'm sure it's possible with a single equation.
fixed link
It looks like some sort of growing sine function. n*sin(n), e^n*sin(n), something like that
Who is online
Users browsing this forum: No registered users and 12 guests