0% found this document useful (0 votes)
6 views

The Joy of Computing using Python - - Unit 7 - week 4

The document outlines the Week 4 assignment for the NPTEL course 'The Joy of Computing using Python', including questions related to magic squares and programming tasks. It provides details on submission deadlines, scores, and accepted answers for various questions. Additionally, it includes references to programming assignments and feedback forms for the course.

Uploaded by

sanat seth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

The Joy of Computing using Python - - Unit 7 - week 4

The document outlines the Week 4 assignment for the NPTEL course 'The Joy of Computing using Python', including questions related to magic squares and programming tasks. It provides details on submission deadlines, scores, and accepted answers for various questions. Additionally, it includes references to programming assignments and feedback forms for the course.

Uploaded by

sanat seth
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4

(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)

[email protected]

NPTEL (https://swayam.gov.in/explorer?ncCode=NPTEL) » The Joy of Computing using Python (course)


Click to register for
Certification exam

Week 4 : Assignment 4
(https://examform.nptel.ac.in/2025_01/exam_form/dashboard)

If already registered, The due date for submitting this assignment has passed.

click to check your Due on 2025-02-19, 23:59 IST.


payment status
Assignment submitted on 2025-02-19, 22:02 IST
1) Which of the following options provides the general formula for the magic constant of a magic square of size n, where all 1 point
Course outline elements are distinct numbers from 1 to n2 ?

About NPTEL () n(n


2
+ 1)

2
How does an NPTEL
online course work? () n
3

Week 1 ()
3
n + 2n

Week 2 () 2

4 2
n + n
Week 3 ()
2n

Yes, the answer is correct.


week 4 ()
Score: 1
Accepted Answers:
Practice is the key (unit?
2
n(n + 1)
unit=78&lesson=79)
2
Magic Square: Hit and n
4
+ n
2

Trial 01 (unit? 2n
unit=78&lesson=80)

Magic Square: Hit and


2) What would the magic constant be for a magic square of size 7, given that all elements in the square are distinct numbers from 1 1 point
Trial 02 (unit? to 49?
unit=78&lesson=81)
260
Magic Square: Hit and
111
Trial 03 (unit?
unit=78&lesson=82) 175
165
Magic Square: Hit and
Trial 04 (unit? Yes, the answer is correct.
unit=78&lesson=83) Score: 1
Accepted Answers:
Magic Square: Hit and 175
Trial 05 (unit?
unit=78&lesson=84)
3) Does transposing any magic square change the sum across some rows/columns/diagonal? 1 point
Let's program and play
(unit?unit=78&lesson=85) Yes
No
Dobble Game - Spot the
similarity 01 (unit? Yes, the answer is correct.
unit=78&lesson=86) Score: 1
Accepted Answers:
Dobble Game - Spot the No
similarity 02 (unit?
unit=78&lesson=87)
4) Which of the following are valid magic squares ? 1 point
Dobble Game - Spot the
similarity 03 (unit?
unit=78&lesson=88)

⎡ ⎤

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 1/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4

10 3 13 8
Dobble Game - Spot the ⎡ ⎤

similarity 04 (unit? ⎢ 5 16 2 11 ⎥
⎢ ⎥
unit=78&lesson=89) ⎢ 4 9 7 14 ⎥
⎣ ⎦
What is your date of 15 6 12 1

birth? (unit?
unit=78&lesson=90) ⎡
20 − e 6 − e 26 − e 16 − e

⎢ 10 − e 32 − e 4 − e 22 − e ⎥
Birthday Paradox - Find ⎢ ⎥
⎢ 8 − e 18 − e 14 − e 28 − 2e ⎥
your twin 01 (unit?
⎣ ⎦
unit=78&lesson=91) 30 − e 12 − e 24 − e 2 − e

Birthday Paradox - Find


1 14 4 15
⎡ ⎤
your twin 02 (unit?
⎢ 8 11 5 10 ⎥
unit=78&lesson=92) ⎢ ⎥
⎢ 13 2 16 3 ⎥
Birthday Paradox - Find ⎣ ⎦
12 7 9 6
your twin 03 (unit?
unit=78&lesson=93)
π 14π 4π 15π
⎡ ⎤
Birthday Paradox - Find ⎢ 8π 11π 5π 10π ⎥
⎢ ⎥
your twin 04 (unit? ⎢ 13π 2π 16π 3π ⎥
unit=78&lesson=94) ⎣ ⎦
12π 7π 9π 6π

Birthday Paradox - Find


Yes, the answer is correct.
your twin 05 (unit? Score: 1
unit=78&lesson=95) Accepted Answers:
10 3 13 8
What's your favourite ⎡ ⎤

movie? (unit? ⎢ 5 16 2 11 ⎥
⎢ ⎥
unit=78&lesson=96) ⎢ 4 9 7 14 ⎥
⎣ ⎦
15 6 12 1
Guess the Movie Name
1 14 4 15
01 (unit? ⎡ ⎤

unit=78&lesson=97) ⎢ 8 11 5 10 ⎥
⎢ ⎥
⎢ 13 2 16 3 ⎥
Guess the Movie Name
⎣ ⎦
02 (unit? 12 7 9 6

unit=78&lesson=98) ⎡
π 14π 4π 15π

⎢ 8π 11π 5π 10π ⎥
Guess the Movie Name ⎢ ⎥
⎢ 13π 2π 16π 3π ⎥
03 (unit?
⎣ ⎦
unit=78&lesson=99) 12π 7π 9π 6π

Guess the Movie Name 5) What is the minimum number of people required to ensure that at least three of them share the same 30-minute birth interval? The
04 (unit? intervals start from 12:00 AM and each interval lasts for half an hour.
unit=78&lesson=100)
97
Guess the Movie Name
05 (unit? Yes, the answer is correct.
unit=78&lesson=101) Score: 1
Accepted Answers:
Guess the Movie Name (Type: Numeric) 97
06 (unit?
unit=78&lesson=102) 1 point

Week 4 Feedback Form: 6) Calculate the magic constant for 5x5 square, where all elements are distinct numbers from 1 to 25, is it same as the magic constant for
The Joy of Computing Ramanujan’s magic square ?
using Python (unit?
unit=78&lesson=103)
If yes, enter 0, else enter the absolute difference between the two.
Quiz: Week 4 : Hint: Search the about Ramanujan’s magic square.
Assignment 4
(assessment?
74
name=515)
Yes, the answer is correct.
Score: 1
Week 4: Programming
Assignment 1
Accepted Answers:
(/noc25_cs69/progassign
(Type: Numeric) 74
ment?name=518)
1 point
Week 4: Programming
7) What task does mystery1() perform? 1 point
Assignment 2
(/noc25_cs69/progassign
ment?name=516)

Week 4: Programming
Assignment 3
(/noc25_cs69/progassign
ment?name=517)

Week 5 ()

Week 6 ()

Week 7 ()

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 2/3
04/04/2025, 09:32 The Joy of Computing using Python - - Unit 7 - week 4

Week 8 ()

Week 9 ()

Week 10 ()

Week 11 ()

Text Transcripts ()

Download Videos ()

Books ()

Problem Solving
Session - Jan 2025 ()

Calculate factorial of number n.


Calculate factors of number n.
Calculate factors of number n+1 excluding n.
Calculate factors of number n excluding n.

Yes, the answer is correct.


Score: 1
Accepted Answers:
Calculate factors of number n excluding n.

8) For what n1, n2 will the variable flag inside mystery2() be equal to True? 1 point

1,2
2,3
3,4
0,0

Partially Correct.
Score: 0.5
Accepted Answers:
2,3
3,4

9) If all possible pairs of prime numbers between 0 and 10, are given to n1 and n2, for how many pairs would 2 print ”Completed” ? 1 point

It will print ”Completed” only for pairs (2,3)(7,2),(2,5), and for the remaining it would not print ”Completed”.
It will print ”Completed” only for pair (2,3), and for the remaining other pairs of primes it would not print ”Completed”.
It will print ”Completed” for all pairs of primes between 0 and 20.
It will not print ”Completed” for any pair.
Yes, the answer is correct.
Score: 1
Accepted Answers:
It will not print ”Completed” for any pair.

10) If numbers of pairs of primes which result in mystery2 to print ”Completed” are lesser than 1, Can we edit the code in mystery2() 1 point
so that ”Completed” is always printed for any pair of primes ?

Yes, we can change the logic for setting flag variable to False.
No, it is logically not possible.
Yes, we can change/decrease the threshold for length of list2 in the last if block.
Yes, we can change the initial value of flag to False, instead of True.

No, the answer is incorrect.


Score: 0
Accepted Answers:
Yes, we can change/decrease the threshold for length of list2 in the last if block.

https://onlinecourses.nptel.ac.in/noc25_cs69/unit?unit=78&assessment=515 3/3

You might also like