NPTEL Data Science for Engineers Week 1 Assignment Answers 2025
1. Which of the following variable names are INVALID in R?
- 1_variable
- variable_1
- _variable
- variable@
Answer :- a, c, d
2. The function ls() in R will
- set a new working directory path
- list all objects in our working environment
- display the path to our working directory
- None of the above
Answer :- b
Consider the following code snippet. Based on this, answer questions 3 and 4.

3. Which of the following command is used to access the value “Shyam”?
- print(patient_list[3][2])
- print(patient_list[[3]][1])
- print(patient_list[[3]][2])
- print(patient_list[[2]][2])
Answer :- For Answers Click Here
4. What does the following R code produce?

- “apple”
- “banana”
- “cherry”
- Error
Answer :-
5. What is the output of following code?

- double
- integer
- list
- None of the above
Answer :-
6. State whether the given statement is True or False.
The library reshape2 is based around two key functions named melt and cast.
- True
- False
Answer :-
7. What does the following R code return?

- 5, 10, 15, 20
- 15, 20
- 10, 15, 20
- Error
Answer :- For Answers Click Here
8. What is the output of the following R code?

- 1, 2, 3
- 0, 1, 2
- 1, 2, 3, 4
- Error
Answer :-
Create the data frame using the code given below and answer questions 8 and 9.
student_data =
data.frame(student_id=c(1:4),student_name=c(‘Ram’,‘Harish’,‘Pradeep’,‘Rajesh’))
9. Choose the correct command to add a column named student_dept to the dataframe student_data.
- student_datastudent_dept=c(“Commerce”, “Biology”, “English”, “Tamil”)
- student_data[“student_dept”]= c(“Commerce”,“Biology”, “English”,“Tamil”)
- student_dept= student_data[c(“Commerce”,“Biology”,“English”,“Tamil”)]
- None of the above
Answer :-
10. Choose the correct command to access the element Tamil in the dataframe student_data.
- student_data[[4]]
- student_data[[4]][3]
- student_data[[3]][4]
- None of the above
Answer :-
11. The command to check if a value is of numeric data type is _____________.
- typeof()
- is.numeric()
- as.numeric()
- None of the above
Answer :-
12. What will the following R code return?

- 6
- 5
- 9
- Error
Answer :-
13. What is the result of the following R code?

- [1] 8 10 12
[2] 14 16 18 - [1] 8 10 12 14 16 18
- [1] 8 9 10 11 12 13
- Error
Answer :- For Answers Click Here
NPTEL Data Science for Engineers Week 2 Assignment Answers 2025
1.

Answer :- For Answers Click here
2. Does the set, S=(1,1),(1,2) spans R2?
- Yes
- No
Answer :-
3.

Answer :-
4. Find the conditions on a and b for which the above system has no solution.
- 2a+b−6=0
- a≠4,2a+b−6=0
- a=4,b=−2
- 2a+b−6≠0
Answer :-
5. Find the conditions on a and b for which the above system has a unique solution.
- 2a+b−6=0
- a≠4,2a+b−6=0
- a=4,b=−2
- 2a+b−6≠0
Answer :-
6. Find the conditions on a and b for which the above system has infite number of solutions.
- 2a+b−6=0
- a≠4,2a+b−6=0
- a=4,b=−2
- 2a+b−6≠0
Answer :- For Answers Click here
7. Identify the number of free variable from the above rwo echelon matrix.
- 0
- 1
- 2
- 3
Answer :-
8. Which among the following is correct for the above system Ax=b?
- It has infinite number of solutions.
- It has a unique solution.
- It has no solution.
Answer :-
9.

Answer :-
10. Which among the following is true for the determinant of a matrix?
- The determinant of a diagonal matrix is the product of its diagonal entries.
- If one row of a matrix is a scalar multiple of another, the determinant is 1.
- If one row of a matrix is a scalar multiple of another, the determinant is 0.
- The determinant of a permutation matrix can only be 1.
Answer :-
11.

Answer :-
12.

Answer :-
13.

Answer :- For Answers Click here