> For the complete documentation index, see [llms.txt](https://alfredo-reyes-montero.gitbook.io/openai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alfredo-reyes-montero.gitbook.io/openai/application/mountain-car-problem/introduction.md).

# Introduction

The mountain car problem can be described as follows:&#x20;

> A car is on a one-dimensional track, positioned between two "mountain". The goal is to drive up the mountain on the right; however, the car's engine is not strong enough to scale the mountain in a single pass. Therefore, the only way to succed is to drive back and forth to build up momentum.

The car´s state, at any point in time, is given by a vector containing its horizontal position and velocity. The car commences each episode stationary, at the bottom of the valley between the hills (at position approximately -0.5), and the episode ends when either the car reaches the flag(position > 0.5) or after 200 moves.

At each move, the car has three action available to it: push left, push right or do nothing, and a penalty of 1 unit is applied for each move taken (including doing nothing). This means that, unless the can figure out a way to ascend the mountain in less than 200 moves, it will always achieve  a total reward of -200 units.
