This exercise is from the Theory section on the melodic minor scale.
Something to be aware of about applying the melodic minor scale is that when it is used to make melodies, often musicians will ascend with it BUT will switch to the natural minor scale when descending. Traditional western music theory informs us that for a smoother melodic flow when ascending (i.e. the melody notes tend towards going higher in pitch), then we should use the melodic minor scale. However, when descending (going lower in pitch), the natural minor scale is then used.
The reason tradition teaches this is to do with 'melodic flow' and making the intervals work with underlying chords. As with most things in music - these are only guidelines, not the law. In practice, musicians will use either scale for ascending or descending.
This ActionTab gives a simple example of a short and easy melody played using the melodic minor (ascending) and natural minor scale notes (descending). The melody is played over an A minor add9 chord, which is also strummed at the very end for you to see. The notes for that chord are: A C E + B.
The melody is played up at the 12th fret, and ascends using notes from the melodic minor scale: A - B - C - D - E - F# - G# - A
Then descends using the natural minor scale: A - G - F - E - D - C - B - A
The ascending melody notes are as follows:
A A B C E F# D E G# A A (from the melodic minor scale)
Then switch to the natural minor, where the descending melody notes are:
G E G E F D E C E C B C B A (from the natural minor scale)
The chord strum at the end is the A minor add9 chord. A very haunting and reflective chord which contains notes that don't conflict with either the A melodic minor or A natural minor scales. Don't worry about the weird name, its a pretty easy chord to play!