We present results from the largest numerical simulation of star formation to resolve the fragmentation process down to the opacity limit . The simulation follows the collapse and fragmentation of a large-scale turbulent molecular cloud to form a stellar cluster and , simultaneously , the formation of circumstellar discs and binary stars . This large range of scales enables us to predict a wide variety of stellar properties for comparison with observations . The calculation clearly demonstrates that star formation is a highly-dynamic and chaotic process . Star formation occurs in localised bursts within the cloud via the fragmentation both of dense molecular cloud cores and of massive circumstellar discs . Star-disc encounters form binaries and truncate discs . Stellar encounters disrupt bound multiple systems . We find that the observed statistical properties of stars are a natural consequence of star formation in such a dynamical environment . The cloud produces roughly equal numbers of stars and brown dwarfs , with masses down to the opacity limit for fragmentation ( \approx 5 Jupiter masses ) . The initial mass function is consistent with a Salpeter slope ( \Gamma = -1.35 ) above 0.5 M _ { \odot } , a roughly flat distribution ( \Gamma = 0 ) in the range 0.006 - 0.5 M _ { \odot } , and a sharp cutoff below \approx 0.005 M _ { \odot } . This is consistent with recent observational surveys . The brown dwarfs form by the dynamical ejection of low-mass fragments from dynamically unstable multiple systems before the fragments have been able to accrete to stellar masses . Close binary systems ( with separations \mathrel { \hbox { \hbox to 0.0 pt { \lower 2.365 pt \hbox { $ \sim$ } } \kern - 3.0 pt \raise 1.72 pt \hbox { $ < $ } } } 10 AU ) are not formed by fragmentation in situ . Rather , they are produced by hardening of initially wider multiple systems through a combination of dynamical encounters , gas accretion , and/or the interaction with circumbinary and circumtriple discs . Finally , we find that the majority of circumstellar discs have radii less than 20 AU due to truncation in dynamical encounters . This is consistent with observations of the Orion Trapezium Cluster and implies that most stars and brown dwarfs do not form large planetary systems .