# Normalizing a function

1. Nov 24, 2011

### maxtor101

Hi all,

Say if I had a function for example $p(x) = \beta \cos(\pi x)$

And I wanted to alter it such that the max value of $p(x)$ is 1 and its minimum value is 0.

How would I go about doing this?

Max

2. Nov 24, 2011

### eumyang

Do you know the minimum and maximum values of $p(x) = \beta \cos(\pi x)$ (before changing p(x))?

3. Nov 24, 2011

### maxtor101

Well yes, the maximum value would be $\beta$ and the minimum value would be $- \beta$..

4. Nov 24, 2011

### dsanz

Well a very simple way to do it would be to first "shrink" your range from being -β to β, and making it 1. You can do this by dividing by 2β, and you get p'(x) = 0.5 cos($\pi$x)
Now your function covers -0.5 to 0.5 so what you have to do now is move its range "up" by 0.5... so you get p''(x) = 0.5 (cos($\pi$x) + 1)