Publications by Brian Singh
BrianSingh_Data605_HW7
1. Let X1, X2, . . . , Xn be n mutually independent random variables, each of which is uniformly distributed on the integers from 1 to k. Let Y denote the minimum of the Xi’s. Find the distribution of Y . If Y is the minimum of the Xi’s and each Xi has k possibilities, then the total # of possibilities for X1, X2,…Xn is \(k^n\) , which be...
892 sym
BrianSingh_Data605_HW6
1. A bag contains 5 green and 7 red jellybeans. How many ways can 5 jellybeans be withdrawn from the bag so that the number of green ones withdrawn will be less than 2? choose(5,1) * choose(7,4) + choose(7,5) ## [1] 196 196 2. A certain congressional committee consists of 14 senators and 13 representatives. How many ways can a subcommittee of 5...
2294 sym
BrianSingh_Data605_HW5
Question 1 (Bayesian). A new test for multinucleoside-resistant (MNR) human immunodeficiency virus type 1 (HIV-1) variants was recently developed. The test maintains 96% sensitivity, meaning that, for those with the disease, it will correctly report “positive” for 96% of them. The test is also 98% specific, meaning that, for those without t...
6484 sym Python (3172 sym/41 pcs)
BrianSingh_Data621_HW1
0.1 Data Exploration # load data library(tidyverse) library(readr) library(curl) library(ggplot2) library(dplyr) library(scales) library(zoo) baseball_training <- read.csv(curl("https://raw.githubusercontent.com/brsingh7/Data621/main/moneyball-training-data.csv")) head(baseball_training) 0.1.1 Summary statistics summary(baseball_training) ## ...
5186 sym R (34054 sym/53 pcs) 5 img
BrianSingh_Data621_Fall2023_HW1
0.1 Data Exploration # load data library(tidyverse) library(readr) library(curl) library(ggplot2) library(dplyr) library(scales) library(zoo) baseball_training <- read.csv(curl("https://raw.githubusercontent.com/brsingh7/Data621/main/moneyball-training-data.csv")) head(baseball_training) 0.1.1 Summary statistics summary(baseball_trainin...
5256 sym R (34555 sym/53 pcs) 5 img
BrianSingh_Data605_HW4
library(doParallel) ## Loading required package: foreach ## Loading required package: iterators ## Loading required package: parallel library(foreach) library(jpeg) library(EBImage) library(OpenImageR) ## ## Attaching package: 'OpenImageR' ## The following objects are masked from 'package:EBImage': ## ## readImage, writeImage library(utils) ...
579 sym R (1993 sym/17 pcs) 2 img
BrianSingh_Data605_HW3
library(pracma) library(Matrix) ## ## Attaching package: 'Matrix' ## The following objects are masked from 'package:pracma': ## ## expm, lu, tril, triu What is the rank of the matrix A? \[ \begin{equation*} \mathbf{}\left[\begin{matrix} 1 & 2 & 3 & 4\\ -1 & 0 & 1 & 3\\ 0 & 1 & -2 & 1\\ 5 & 4 & -2 & -3 \end{matrix}\right] \end{equation*} \] ...
1466 sym R (879 sym/17 pcs)
BrianSingh_Data605_HW2
Problem Set 1. 1. Show that AT A not = AAT in general. (Proof and demonstration.) a. Create matrix A A <- matrix(c(1,2,3,4,-1,-2,-3,-4,5,6,7,8,-5,-6,-7,-8), nrow=4, byrow=TRUE) A ## [,1] [,2] [,3] [,4] ## [1,] 1 2 3 4 ## [2,] -1 -2 -3 -4 ## [3,] 5 6 7 8 ## [4,] -5 -6 -7 -8 b. Transpose Matrix A ...
1308 sym Python (1668 sym/15 pcs)
BrianSingh_Data605_HW1
library(animation) #setwd("D:/") x=c(seq(0,0.5, length.out = 500),rep(0, 500),seq(0,0.5, length.out = 500),rep(0.5, 500),seq(0,0.5, length.out = 500),rep(-1,500),seq(-0.5,-1,length.out=500),rep(-0.5,500),seq(-0.5,-1,length.out=500),rep(-0.25,500),seq(-0.25,-1,length.out=500),seq(-0.5,-0.25,length.out=500)) y=c(rep(1, 500),seq(1,0, length.out = 500...
18 sym R (1794 sym/9 pcs) 501 img
BrianSingh_Data608_Module5
1) Create a function to reverse any word that you type in. This can be typed into either an input box or an alert box, and then print the result in a box or on the webpage. 2) Create a function that takes an input number, and prints a table with the first 20 multiples of the number, in order 5×4. Example: Type in “2” and it results in 2468 ...
355 sym 1 tbl