To solve the conflicts between spectrum scarcity and spectrum under-utilization, cognitive radio (CR) technology has been recently proposed. It can improve the spectrum utilization by allowing secondary networks (users) to make use of unused radio spectrum from primary licensed networks (users) or to share the spectrum with the primary networks (users). As an intelligent wireless communication system, a cognitive radio is sentient of the radio frequency environment. It selects the communication parameters such as carrier frequency, bandwidth, and transmission power to optimize the spectrum usage and adapts its transmission and reception accordingly. Cooperative spectrum sensing is considered where multiple cognitive radios detect the spectrum holes collaboratively through energy detection and examine the optimality of cooperative spectrum sensing. The aim is to optimize the detection per-formance in an efficient way. The optimal voting rule is derived for any detector functional to cooperative spectrum sensing. Also optimize the detection threshold when energy detection is in use. To conclude, we propose a spectrum sensing algorithm for the network which requires smaller quantity than the total number of cognitive radios in cooperative spectrum sensing while fulfilling a given error hurdle.