Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 10th, 2004, 03:27 PM
theflintstar theflintstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 theflintstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how do i solve this Algorithm, proof by induction?

let the array be: a

and the array is an array of integers n+1 such that.

a[1] <= a[0] and a[n - 1] <= a[n]

how do i deduce that a must contain a local minimum in
a[1]....a[n-1].

(a[k] is a local minimum if it satisfies)
a[k] <= a[k - 1] and a[k] <= a[k + 1]

i'm not sure but do i have to do it by proof by induction.
can anyone help please?

Reply With Quote
  #2  
Old November 10th, 2004, 06:46 PM
Lux Perpetua Lux Perpetua is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: San Francisco Bay
Posts: 1,475 Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level)Lux Perpetua User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 3 Weeks 6 Days 20 m 57 sec
Reputation Power: 377
This is a regular math problem, not an algorithm

If a[1] is not a local minimum, it is a "decreasing point" (what does this mean?). Since the array is finite, there is a largest k such that a[k] is a decreasing point. k < n-1 (why?). What are the possibilities for a[k+1]?

That's an outline of one possible proof. I left it incomplete; it's best for you to fill the gaps yourself. I hope that helps.

Reply With Quote
  #3  
Old November 11th, 2004, 11:09 AM
theflintstar theflintstar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 theflintstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks

many thanks!

Reply With Quote
  #4  
Old November 19th, 2004, 08:38 AM
emotional_robot emotional_robot is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 53 emotional_robot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 40 m 35 sec
Reputation Power: 5
Send a message via Yahoo to emotional_robot
Quote:
Originally Posted by theflintstar
many thanks!
You can do it in this way ..let the array be in increasing
order(In calculas we say function is increasing)
=>a[1]>a[0],a[2]>a[1].............a[n]>a[n-1]
=>our assumption is wrong...
Take the second case
let the array be in decreasing order
=>a[1]<a[0],a[2]<a[1].......a[n]<a[n-1]
=>our assumption is wrong...
So the array is decreasing in some range and increasing in some range .
In this case it is decreasing initially and then increasing
So there is a local minima...
The problem can be converted for local maxima also

Such proofs are called as prooving by contradiction

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > how do i solve this Algorithm, proof by induction?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT