Abstract Cognitive radio technology is in fast development and is considered a possible solution to improve the efficiency of radio spectrum use . Many studies have been recently carried out in order to improve spectrum-sharing techniques between primary and secondary users. This paper investigates one of the basic decision problems faced by a cognitive radio: given a time window of a specific size, a secondary user (SU) should decide if it will use it or not, minimizing the chances of collision with a primary user (PU). For this purpose, an algorithm is proposed that does not require previous information about PU occupancy behavior. The proposed algorithm shows very good performance when compared to three other methods recently proposed to tackle with this problem.