Focusing light through scattering media using wavefront shaping technique has drawn numerous interests, and shown great potential in various applications including super-resolution imaging, deep tissue microscopy and polarization control. The high speed of amplitude optimization based on digital micromirror devices has the potential to focus light through living biological materials. In this paper, we introduce an adjust binary harmony search (ABHS) algorithm to optimize the amplitude of the incident light. To test the performance and effectiveness of the ABHS algorithm, we establish a numerical simulation model based on random matrix theory. The linear relationship between intensity enhancement and controlled number of segments indicates the validity of our numerical simulation model. Furthermore, we compare the performance of ABHS algorithm with continuous sequential algorithm (CSA) and genetic algorithm (GA) in noisy and fluctuating environments. The simulation results show that ABHS reaches a larger overall enhancement than CSA and GA algorithm in noisy and fluctuating circumstances.