You can also purchase an all day ticket which is good for trolleys, buses and the U/S bahn by pressing the tageskarte button instead of the Einzelfahrt button. It is possible to board the train or trolley without purchasing a ticket but you will be fined 60 EUR minmum and these checks do occur regularly. You can purchase train ticket online from the official homepage of deutsche Bahn by clickin.