FALLSEM2024-25_BCSE401L_TH_VL2024250102077_CAT-2-QP-_-KEY

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

SCHOOL OF COMPUTER SCIENCE AND ENGINEERING

CONTINUOUS ASSESSMENT TEST - II


FALL SEMESTER 2024-2025 SLOT: C1+TC1
---------------------------------------------------------------------------------------------------------------------------------------
Programme Name & Branch : B.Tech. Computer Science and Engineering
Course Code and Course Name : BCSE401L- Internet of Things
Date of Examination : 15.10.2024
Maximum Marks : 50
Answer Key
Course Outcomes:
CO3: Comprehend advanced IoT applications and technologies from the basics of IoT.
CO5: Understand the challenges of IoT using privacy and security metrics.
CO6: Solve real time problems and demonstrate IoT applications in various domains using prototype models.
Q.
Question M CO BL
No
1. a) Imagine you have a large dataset of customer transactions. If you want to predict 4 CO3 BL3
future purchases based on previous behaviours, what type of learning would you
use and why? Mention the types of identified learning.

Scheme of Evaluation:
Sl. No. Topic Marks
1 Identification 1
2 Justification 1
3 Types 2
Total 4

This scenario suggests the use of supervised learning because we are trying to
predict a specific outcome (future purchases) based on labeled data (previous
behaviors). Supervised learning utilizes a known target variable to train the model.
Types:
 K-Nearest Neighbour
 Naïve Bayes Classifier
 Linear Regression
 Logistic Regression
b) Apply linear regression for the following data of table. Estimate the value of y 6
when x = 55 using least square method. Here, x and y represent the age and
glucose level of the corresponding person, respectively.
x = age 43 21 25 42 57 59
y = glucose level 99 65 79 75 87 81

Scheme of Evaluation:
Sl. No. Topic Marks
1 Formula 2

∑ ∑

∑ ∑ ∑
∑ ∑

Page 1 of 9
2 Calculation of 2
3 Calculation of 1
4 Final value of y when x = 55 1
Total 6

Subject Age x Glucose Level y xy x2 y2

1 43 99 4257 1849 9801

2 21 65 1365 441 4225

3 25 79 1975 625 6241

4 42 75 3150 1764 5625

5 57 87 4959 3249 7569

6 59 81 4779 3481 6561

Σ 247 486 20485 11409 40022

∑ ∑
= = 65.15

Therefore, we can write


y = 0.385 × x + 65.15
when x = 55, This gives y = (0.385 × 55) + 65.15 = 86.325

2. a) Given TP = 40, TN = 30, FP = 20 and, FN = 10, determine accuracy, precision, 4 CO3 BL4
recall (sensitivity), and F1 score.

Scheme of Evaluation:
Sl. No. Topic Marks
1 Formulas for 2
Accuracy (0.5Marks)
Precision (0.5 Mark)
Recall (0.5 Mark)
F1 Score (0.5 Mark)
2 Calculations for 2
Accuracy (0.5Marks)
Precision (0.5 Mark)
Recall (0.5 Mark)
F1 Score (0.5 Mark)
Total 4

Page 2 of 9
40  30 70
Accuracy    0.7
40  30  20  10 100
40 40
Pr ecision    0.67
40  20 60
40 40
Re call    0.8
40  10 50
2 * 40 80
F1 Score    0.72
(2 * 40)  20  10 110
b) Consider a multilayer feed-forward neural network given below. Let the learning 6
rate be 0.5. Assume initial values of weights as given in the table below. Train the
network for the training tuple (1, 1, 0), where last number is target output.
Perform back propagation algorithm to find the g1, g2 and loss using Mean Square
Error. Assume that sigmoid activation function is used in the network. Here
Inputs X1=1, X2=1, Output Out=0
Weight values
W1 W2 W3 W4 W5 W6
0.5 0.2 -0.3 0.5 0.1 0.3

Scheme of Evaluation:
Sl. No. Topic Marks
1 Formula 2

2 Calculation of 1
3 Calculation of 1
4 Calculation of Out 1
5 Calculation of loss 1
Total 6

Initial weight calculations, we compute using

Now, we compute using

Page 3 of 9
In order to calculate the out, we need

= 0.256

Subsequently, the loss is computed using mean squared error as

3. a) Imagine a scenario where a group of generals, each commanding their own army, 4 CO5 BL3
is encamped around a city. To successfully attack, they must agree on a
coordinated attack plan. However, some generals may be traitors who will try to
mislead others. Identify and discuss the mechanism in block chain technology to
allow the loyal generals to agree on a single plan while preventing traitors from
influencing the decision.
Scheme of Evaluation:
Sl. No. Topic Marks
1 Identification 1
2 Explanation with relevant diagram 3
Total 4

mechanism : Byzantine Generals Problem

 Any modification to the block must be approved by a majority of the users of


the networks. This is because the modification made to the block is permanent
and immutable once recorded. This makes the networks decentralized where
there is no central authority like a bank.
 Let us assume that there are four generals, out of them, three are loyal and one
is a traitor as shown in figure above.
 The loyal general gives the command to attack, while the traitor to not attack.
The generals are not at one place, they communicate among themselves. The
goal is victory even if a minority of the generals are traitors.
 In this scenario, the loyal general receives the 2 commands for attack and 1
command to not attack. The majority of commands are to attack, therefore,

Page 4 of 9
they attack the enemy. This is called Byzantine fault tolerance.
 On similar lines, in blockchain networks, the generals are the nodes and the
messages are the transactions. Attack command is the legitimate transaction,
while to not attack command is the invalid transaction

Consider medical dataset from a fictitious hospital located in upstate New York. 6
Apply k-anonymity and l-diversity anonymization techniques for dataset with k=4
and l=3.
Non-Sensitive Data Sensitive Data
# ZIP Age Nationality Condition
1 25038 28 Russian Flu
2 25079 29 American Flu
3 25079 21 Japanese Cold
4 25038 23 American Cold
5 14853 50 Indian Heart
6 14853 55 Russian Flu

7 14850 47 American Cold


8 14850 49 American Cold
9 25038 31 American Heart
10 25038 37 Indian Heart
11 25079 36 Japanese Heart
12 25079 35 American Heart

Scheme of Evaluation:
Sl. No. Topic Marks
1 4-Anonymity table with explanation 3
2 3-diversity table with explanation 3
Total 6

4-Anonymity
Non-Sensitive Data Sensitive Data
# ZIP Age Nationality Condition
1 250** <30 * Flu
2 250** <30 * Flu
3 250** <30 * Cold
4 250** <30 * Cold
5 148** ≥40 * Heart
6 148** ≥40 * Flu
7 148** ≥40 * Cold
8 148** ≥40 * Cold
9 250** 3* * Heart
10 250** 3* * Heart
11 250** 3* * Heart
12 250** 3* * Heart

Page 5 of 9
 k-Anonymity can create groups that due to lack of diversity in the the
sensitive attribute leak information.
 k-Anonymity does not protect against attacks based on background
knowledge.
3-diversity:
Non-Sensitive Data Sensitive Data
# ZIP Age Nationality Condition
1 2503* ≤40 * Flu
4 2503* ≤40 * Cold
9 2503* ≤40 * Heart
10 2503* ≤40 * Heart
5 1485* >40 * Heart
6 1485* >40 * Flu
7 1485* >40 * Cold
8 1485* >40 * Cold
2 2507* ≤40 * Flu
3 2507* ≤40 * Cold
11 2507* ≤40 * Heart
12 2507* ≤40 * Heart

4. a) Imagine a group of friends who regularly exchanges money for shared expenses. 4 CO5 BL4
They want to avoid high bank fees and ensure immediate settlement of payments.
In comparison with traditional banking methods, how would blockchain
technology allow them to process transactions more efficiently?

Scheme of Evaluation:
Sl. No. Topic Marks
1 Identification 1
2 Explanation about miner and transaction 3
in Blockchain with diagram
Total 4
Identification: Miner and transaction in Blockchain
 The transaction details are deducted amount for the sender and credited
amount for the receiver. There is no actual transfer of digital currency.
 Only the transaction is recorded in the ledger of blockchain. The transaction
detail is passed through the SHA-256 cryptographic hashing function.
 The transaction detail is signed using the user’s private key. The sender
broadcasts the encrypted transactions with amount of bitcoin network to be
transferred.
 The miner receives the transaction, verifies, and validates it. The miner then
includes it in a block and propagates it to other bitcoin users. There are three
input, namely, previous hash, Merkle root hash and the nonce to SH-256
cryptographic hashing algorithm.
 The miner varies the nonce, while the previous hash and Merkle root remain
the same, to generate a hash value lower than the target.

Page 6 of 9
b) Consider the elliptic curve for a=1, b=0, and 6
with generator point and encoded message on the curve,
( ) . Assume the private key for sender and receiver
are 3 and 2 respectively.

Value of 𝟑λ mod 7 Value of 2λ mod 7


Λ 1 2 3 4 5 6 7 λ 1 2 3

3λ 3 6 9 12 15 18 21 2λ 2 4 6

3λ mod 7 3 6 2 5 1 4 0 2λ mod 7 2 4 6
Compute public key of the sender ( Spub)

Scheme of Evaluation:
Sl. No. Topic Marks
1 = 2 = + + 1
Formulas for 2
if A≠ B (0.5 Mark)
if if A= B (0.5 Mark)
(0.5 Mark)
y (0.5 Mark)
2 2 = + of C( c , yc) = (1,4) 1.5
=7 (0.5 Mark)
c (0.5 Mark)
yc 4 (0.5 Mark)
3 2 of = C( d , yd) = (5,5) 1.5
=3 (0.5 Mark)
c 5 (0.5 Mark)
yc 5 (0.5 Mark)
Total 6

Compute the public key of the sender


– ( ) ( )
2 = + +
– Hence, (a) Compute 2 = + and then (b) Add

Solution for 2 = +
A(3,3) for E7(1,0) then compute xc
slope (λ)= if A= B

mod 7
mod 7 0
=7

xc= λ2-2xa (mod p) yc= λ(xa-xc)-ya(mod p)


yc= 7*(3-1)-3 (mod 7)
c 43 mod 7 yc mod 4
4

g+g(2g) = C( c , yc) = (1,4)

Page 7 of 9
Consider two points 2g =A(1,4) and g= B(3,3) for E7(1,0) then compute
slope (λ)= (mod p) if A≠ B

mod 7

xd= λ2-xa-xb (mod p) yd = λ(xa-xd)-ya(mod p)


xd = 32-1-3 (mod 7) yd = 3*(1-5)-4 (mod 7)
d 5 mod 7 yd - 6 mod 7
xd 5 yd 5

=A+B = C( c , yc) = (5,5)

5. Analyze the various wearable biomedical sensors used for human activity recognition, 10 CO6 BL4
identifying the best sensor for arrhythmia detection and its role in health monitoring
with relevant diagram. Additionally, mention the drawback of using image/video
method and explore how wireless link-based approaches can utilize channel state
information for human activity recognition.

Scheme of Evaluation:
Sl. No. Topic Marks
1 Various wearable biomedical sensors 3
3 Identification of sensor used for 3
arrhythmia detection and its role in health
monitoring with diagram
4 Drawback of using image/video method 1
5 channel state information for human 3
activity recognition.
Total 10

Various wearable biomedical sensors


 Electromyography (EMG): To assess the health of muscles.
 Electroencephalograph (EEG): To detect abnormalities in the brain waves.
 Electrocardiogram (ECG): To record electrical activity of the heart.
 Accelerometer (ACC): To measure acceleration of the body.
 Electrodermal Activity (EDA): To measure changes in the electrical
properties of the skin.
 Respiration (RESP): To measures breathing rate.
 Force (FSR): To detect numbness of the body.
 Temperature (TEMP): To measure body temperature.
 The other biomedical sensors are blood pressure sensor, Galvanic skin
re sponse sensor, airflow sensor, sound generator, body position sensor,
snore sen sor, alert patient button, spirometer, glucometer, and SPO2 pulse
oximeter

Identification of sensor for arrhythmia detection


 arrhythmia is detected using Electrocardiogram (ECG) signals

ECG Sensor used for arrhythmia detection and its role in health monitoring
 There are three main components of an ECG signal: P wave, QRS complex,

Page 8 of 9
and T wave. The P wave, QRS complex, and R peak represent atrial
depolarization, ventricular depolarization, and ventricular repolarization,
respectively.
 QRS complex gives information about cardiac arrhythmias. The R peak is
detected using the Pan-Tompkins algorithm. Subsequently, the classification
of normal, ventricular, and super-ventricular beats are carried out. The
challenge is that normal beat and superventricular beats are similar.
Therefore, 2-stage data analytic is used as shown in below figure. In the first
stage, ventricular beat is separated from the normal plus super-ventricular
beats. In the next stage, the normal and super-ventricular beats are separated.

Drawback of using image/video method


 wearable sensors may cause discomfort to humans. Image/video-based HAR
consumes a lot of bandwidth during transmission and breaches the privacy of
users.

Human Activity Recognition Using Channel State Information


 CSI used between transmitter and receiver to recognize the activity of a
person as shown in figure below.
 Wi-Fi access points present in the environment act as a transmitter and smart
device as a receiver. The medium between a transmitter and a receiver is
called a channel.
 The CSI is a complex number and hence has both magnitude and phase.
These magnitude and phase give a unique signature for different activities.
 A public dataset of CSI for activity recognition is of Stanford data dump of
Ermon Group.
 Linux 802.11n CSI Tool is used to get CSI at 1000 Hz. The tool is built using
Intel Wi-Fi Wireless Link 5300 802.11n MIMO. There are 90 subcarriers and
each subcarrier has amplitude and phase.
 The first column of the CSI dataset is time-stamp. The second to ninety-first
columns are amplitude data. Finally, ninety-second to one hundred eighty-
first columns is phase data for 30 subcarriers times 3 antennas of a MIMO
system.
 Generally, the CSI contains the carrier frequency offset and sampling
frequency offset. If we take the difference of two CSI for the same activity,
the offset can be easily canceled. This soft computing approach enhances the
activity recognition performance.
 The differential CSI is further fed to things data analytic for classification of
different activities. The different classified activities are sitting, lying on the
bed, walk, pick up, stand up, run and fall.
 One application of the sensed activities can be in a pacemaker for maintaining
the required heart rate using a controller.

Page 9 of 9

You might also like