Create gaussian1.py
This commit is contained in:
		
							parent
							
								
									bbd7b4bec8
								
							
						
					
					
						commit
						8e89de9a0e
					
				
							
								
								
									
										8
									
								
								misc/challenges/gaussian1.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								misc/challenges/gaussian1.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					import math
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def f(m, s, x):
 | 
				
			||||||
 | 
					  fraction = 1/(math.sqrt(2*math.pi)*s)
 | 
				
			||||||
 | 
					  brackets = -(1.0/2.0)*((x-m)/s)**2
 | 
				
			||||||
 | 
					  return fraction*math.exp(brackets)
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					print f(0.0, 2.0, 1.0)
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user