# Create a Normal Curve

```
| makeresults count=50000
| eval r = random() / (pow(2,31)-1)
| eval r2 = random() / (pow(2,31)-1)
| eval normal = sqrt(-2 * ln(r)) * cos(2 * pi() * r2)
| bin normal span=0.1
| stats count by normal
| makecontinuous normal
```

It's a pretty popular search command and it is used in all sorts of situations. Below are some really cool searches that use *makeresults* along with other search commands.

```
| makeresults count=50000
| eval r = random() / (pow(2,31)-1)
| eval r2 = random() / (pow(2,31)-1)
| eval normal = sqrt(-2 * ln(r)) * cos(2 * pi() * r2)
| bin normal span=0.1
| stats count by normal
| makecontinuous normal
```

```
| makeresults
| eval days_in_month=mvindex(split(if(tonumber(strftime(_time,"%y"))%4=0,"31,29,31,30,31,30,31,31,30,31,30,31","31,28,31,30,31,30,31,31,30,31,30,31"),","),tonumber(strftime(_time,"%m"))-1)
```

```
| makeresults count=5
| eval aging=random()%25
| eval end=_time
| eval start=end-(aging*86400)
| eval range=mvrange(start, end, 86400)
| convert ctime(range) timeformat="%+"
| eval BusinessDays=mvcount(mvfilter(NOT match(range,"(Sun|Sat).*")))
```