The formation and evolution of active regions is an inherently complex phenomenon . Magnetic fields generated at the base of the convection zone follow a chaotic evolution before reaching the solar surface . In this article , we use a 2-D probabilistic Cellular Automaton ( CA ) to model the statistical properties of the magnetic patterns formed on the solar surface and to estimate the magnetic energy released in the interaction of opposite polarities . We assume that newly emerged magnetic flux tubes stimulate the emergence of new magnetic flux in their neighborhood . The flux-tubes move randomly on the surface of the sun , and they cancel and release their magnetic energy when they collide with magnetic flux of opposite polarity , or diffuse into the “ empty ” photosphere . We assume that cancellation of magnetic flux in collisions causes “ flares ” and determine the released energy as the difference in the square of the magnetic field flux ( E \sim B ^ { 2 } ) . The statistics of the simulated “ flares ” follow a power-law distribution in energy , f ( E ) \sim E ^ { - a } , where a = 2.2 \pm 0.1 . The size distribution function of the simulated active regions exhibits a power law behavior with index k \approx 1.93 \pm 0.08 , and the fractal dimension of the magnetized areas on the simulated solar surface is close to D _ { F } \sim 1.42 \pm 0.12. Both quantities , D _ { F } and k , are inside the range of the observed values .