File:Greedy Glouton.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 512 × 512 pixels, file size: 22 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Illustrating a greedy algorithm that, starting at a given point on a curve, tries to find the curve's global maximum by following the steepest slope from its current position. For this case, the local maximum "m" will be found, while the global maximum "M" will be missed, because the slope from "A" toward "m" is always steeper than that toward "M", both at "A" and all along the path from "A" to "m".
Français : Illustration d'un algorithme glouton: le maximum local "m" sera trouvé. Le maximum global "M" ne sera pas trouvé.
Date
Source Own work
Author Tos
SVG development
InfoField
 
The SVG code is valid.
 
This diagram was created with Mathematica.
 
This diagram uses embedded text.
Source code
InfoField

Mathematica code

<source lang="c">
h[x_] := (2 x + 4)*Exp[-2*x*x];
j[x_] := (2 - Abs[x - 4]);
Plot[
 Piecewise[{{h[x] - h[2], x < 2}, {j[x], (6 > x > 2)}, {0, (x > 6)}}], {x, -2, 6.5}, 
 Filling -> Bottom,
 Axes -> False,
 PlotRange -> {-0.5, 5}, 
 Epilog -> {PointSize[0.012], Point[{0.12, h[0.12]}], Point[{2, 0}], 
   Point[{4, j[4]}], Text["A", {2.04, 0.3}], 
   Text["M", {0.15, h[0.15] + .3}], Text["m", {4.04, 2.3}]}
]

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:53, 8 August 2011Thumbnail for version as of 09:53, 8 August 2011512 × 512 (22 KB)Tos (talk | contribs)

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file: