---
title: "MATH-650 Assignment-1"
author: 'Saket Choudhary (USCID: 21270058637) (skchoudh@usc.edu)'
date: "08/25/2015"
output: html_document
---

### Generate $x$,$y$ $\sim$ $N(0,1)$

Generate two sets of random numbers $x$,$y$:

```{r}
##Set seed to ensure reproduciblity
set.seed(10)
x <- rnorm(10, mean=0, sd=1)
y <- rnorm(10, mean=0, sd=1)
mean_x <- mean(x)
mean_y <- mean(y)
difference_of_mean_xy <- mean_x - mean_y
print(difference_of_mean_xy)
```

Difference of mean of $x$, $y$ is: `r difference_of_mean_xy`

### t-test for $x,y \sim N(0,1)$
```{r}
t_test <- t.test(x,y)
print(t_test)
```

From the t-test results with degrees of freedom `r (t_test$paramter)` and a p-value of $`r (t_test$p.value)`$ and using a threshold level of significance of $\alpha = 0.01$, we *FAIL to reject* the null hypothesis that the means of two samples, $x$ and $y$ are equal. [Since p-value < $\alpha$]

### Generate $x \sim N(0,1)$,$y \sim N(2,1)$



```{r}
##Set seed to ensure reproduciblity
set.seed(10)
x <- rnorm(10, mean=0, sd=1)
y <- rnorm(10, mean=2, sd=1)
mean_x <- mean(x)
mean_y <- mean(y)
difference_of_mean_xy <- mean_x - mean_y
print(difference_of_mean_xy)
```

Difference of mean of $x$, $y$ is: `r difference_of_mean_xy`

### t-test for $x \sim N(0,1)$,$y \sim N(2,1)$
```{r}
t_test <- t.test(x,y)
print(t_test)
```

From the t-test results with degrees of freedom `r (t_test$parameter)` and a p-value of $`r (t_test$p.value)`$ and using a threshold level of significance of $\alpha = 0.01$, we *reject* the null hypothesis that the means of two samples, $x$ and $y$ are equal.[Since p-value of $`r t_test$p.value` < \alpha$]



