COMP7015 Assignment 4 Sample Solutions

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

COMP7015 Artificial Intelligence Semester 1, 2023–24

Sample Solution to Assignment 4


Instructor: Dr. Kejing Yin updated on Dec. 7, 2023

Problem 1: Computational Graphs and Backpropagation


Q1: The computational graph is as follows.

(·)2
<latexit sha1_base64="3oAvRRHbp0QVhs/7BPz72Pzyu7k=">AAAB8HicbVBNSwMxEJ31s9avqkcvwSLUS9ktoh6LXjxWsB/SriWbzbah2WRJskJZ+iu8eFDEqz/Hm//GtN2Dtj4YeLw3w8y8IOFMG9f9dlZW19Y3Ngtbxe2d3b390sFhS8tUEdokkkvVCbCmnAnaNMxw2kkUxXHAaTsY3Uz99hNVmklxb8YJ9WM8ECxiBBsrPVR6JJTm7LHWL5XdqjsDWiZeTsqQo9EvffVCSdKYCkM41rrruYnxM6wMI5xOir1U0wSTER7QrqUCx1T72ezgCTq1SogiqWwJg2bq74kMx1qP48B2xtgM9aI3Ff/zuqmJrvyMiSQ1VJD5oijlyEg0/R6FTFFi+NgSTBSztyIyxAoTYzMq2hC8xZeXSatW9S6q3t15uX6dx1GAYziBCnhwCXW4hQY0gUAMz/AKb45yXpx352PeuuLkM0fwB87nD8vij8E=</latexit>

2 · residual
<latexit sha1_base64="MEp90SCxKuoaNndEAtfimw4DVbc=">AAACB3icbVA9SwNBEN2LXzF+RS0FWQyCVbgLopZBG8sI5gOSEPb2JsmSvdtjd04IRzob/4qNhSK2/gU7/417SQpNfDDweG+GmXl+LIVB1/12ciura+sb+c3C1vbO7l5x/6BhVKI51LmSSrd8ZkCKCOooUEIr1sBCX0LTH91kfvMBtBEqusdxDN2QDSLRF5yhlXrF40qHBwppR8WgGSodsRBSDUYECZOTXrHklt0p6DLx5qRE5qj1il+dQPEkhAi5ZMa0PTfGbso0Ci5hUugkBmLGR2wAbUuzbaabTv+Y0FOrBLSvtK0I6VT9PZGy0Jhx6NvOkOHQLHqZ+J/XTrB/1U1FFCcIEZ8t6ieSoqJ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UwjgEmpwC3VoAIM+PMMrvHnSe/HevY95a8HLZw7hD7zPH//jjZ0=</latexit>

y1
<latexit sha1_base64="xMOtnMnf4SvcLzdb23/Nd926bf0=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8eK1hbaUDbbTbt0swm7EyGE/gQvHhTx6i/y5r9x2+agrQ8GHu/NMDMvSKQw6LrfTmlldW19o7xZ2dre2d2r7h88mjjVjLdYLGPdCajhUijeQoGSdxLNaRRI3g7GN1O//cS1EbF6wCzhfkSHSoSCUbTSfdb3+tWaW3dnIMvEK0gNCjT71a/eIGZpxBUySY3pem6Cfk41Cib5pNJLDU8oG9Mh71qqaMSNn89OnZATqwxIGGtbCslM/T2R08iYLApsZ0RxZBa9qfif100xvPJzoZIUuWLzRWEqCcZk+jcZCM0ZyswSyrSwtxI2opoytOlUbAje4svL5PGs7l3UvbvzWuO6iKMMR3AMp+DBJTTgFprQAgZDeIZXeHOk8+K8Ox/z1pJTzBzCHzifPw8ujac=</latexit>

1 1

+
c
<latexit sha1_base64="y0AG5APw9wGNcAd7gW4VG6KTT5Y=">AAAB6HicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8cW7Ae0oWy2k3btZhN2N0IJ/QVePCji1Z/kzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU0nGqGDZZLGLVCahGwSU2DTcCO4lCGgUC28H4bua3n1BpHssHM0nQj+hQ8pAzaqzUYP1yxa26c5BV4uWkAjnq/fJXbxCzNEJpmKBadz03MX5GleFM4LTUSzUmlI3pELuWShqh9rP5oVNyZpUBCWNlSxoyV39PZDTSehIFtjOiZqSXvZn4n9dNTXjjZ1wmqUHJFovCVBATk9nXZMAVMiMmllCmuL2VsBFVlBmbTcmG4C2/vEpaF1Xvquo1Liu12zyOIpzAKZyDB9dQg3uoQxMYIDzDK7w5j86L8+58LFoLTj5zDH/gfP4AyF2M7Q==</latexit>

1 1

·
<latexit sha1_base64="fCo//J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7m0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU1HGqGDZYLGLVDqhGwSU2DDcC24lCGgUCW8Hobua3xqg0j+WTmSToR3QgecgZNVZ6HPe8XrniVt05yCrxclKBHPVe+avbj1kaoTRMUK07npsYP6PKcCZwWuqmGhPKRnSAHUsljVD72fzUKTmzSp+EsbIlDZmrvycyGmk9iQLbGVEz1MveTPzP66QmvPEzLpPUoGSLRWEqiInJ7G/S5wqZERNLKFPc3krYkCrKjE2nZEPwll9eJc2LqndV9R4uK7XbPI4inMApnIMH11CDe6hDAxgM4Ble4c0Rzovz7nwsWgtOPnMMf+B8/gAKnI2k</latexit>

h11
<latexit sha1_base64="qsSN3IZQIEqK5ToFgaMf+Dh9T1c=">AAAB7XicbVBNSwMxEJ2tX7V+VT16CRbBU9mIVI9FLx4r2A9ol5JNs21sNlmSrFCW/gcvHhTx6v/x5r8xbfegrQ8GHu/NMDMvTAQ31ve/vcLa+sbmVnG7tLO7t39QPjxqGZVqyppUCaU7ITFMcMmallvBOolmJA4Fa4fj25nffmLacCUf7CRhQUyGkkecEuuk1qifYTztlyt+1Z8DrRKckwrkaPTLX72BomnMpKWCGNPFfmKDjGjLqWDTUi81LCF0TIas66gkMTNBNr92is6cMkCR0q6kRXP190RGYmMmceg6Y2JHZtmbif953dRG10HGZZJaJuliUZQKZBWavY4GXDNqxcQRQjV3tyI6IppQ6wIquRDw8surpHVRxbUqvr+s1G/yOIpwAqdwDhiuoA530IAmUHiEZ3iFN095L96797FoLXj5zDH8gff5Ayqhjt0=</latexit>

v2
<latexit sha1_base64="QpDMvqMuPU75GXzQ0xQDGkNsYnI=">AAAB6nicbVBNS8NAEJ34WetX1aOXxSJ4KkkR9Vj04rGi/YA2lM120i7dbMLuplBCf4IXD4p49Rd589+4bXPQ1gcDj/dmmJkXJIJr47rfztr6xubWdmGnuLu3f3BYOjpu6jhVDBssFrFqB1Sj4BIbhhuB7UQhjQKBrW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CF0TIas66gkMTNBNr92is6cMkCR0q6kRXP190RGYmMmceg6Y2JHZtmbif953dRG10HGZZJaJuliUZQKZBWavY4GXDNqxcQRQjV3tyI6IppQ6wIquRDw8surpHVRxbUqvr+s1G/yOIpwAqdwDhiuoA530IAmUHiEZ3iFN095L96797FoLXj5zDH8gff5Ayqhjt0=</latexit>

<latexit sha1_base64="divmcn7cMkGD54tEnPYuQJlAg+0=">AAACA3icbVBNS8NAEN34WetX1JtegkWol5KIqMeiF48V7Ac0oWw223bpZjfsToQSCl78K148KOLVP+HNf+OmzUFbHww83pthZl6YcKbBdb+tpeWV1bX10kZ5c2t7Z9fe229pmSpCm0RyqToh1pQzQZvAgNNOoiiOQ07b4egm99sPVGkmxT2MExrEeCBYnxEMRurZh75MqMIglcAxzQCL4aTqk0jCac+uuDV3CmeReAWpoAKNnv3lR5KkMRVAONa667kJBBlWwAink7KfappgMsID2jU0X6iDbPrDxDkxSuT0pTIlwJmqvycyHGs9jkPTGWMY6nkvF//zuin0r4KMiSQFKshsUT/lDkgnD8SJmKIE+NgQTBQztzpkiBUmYGIrmxC8+ZcXSeus5l3UvLvzSv26iKOEjtAxqiIPXaI6ukUN1EQEPaJn9IrerCfrxXq3PmatS1Yxc4D+wPr8AY26mBg=</latexit>

tanh(·)
v1
<latexit sha1_base64="S2gUnD3n5H7zQ610Z5P4adhD600=">AAAB6nicbVBNS8NAEJ3Ur1q/qh69LBbBU0lE1GPRi8eK9gPaUDbbSbt0swm7m0IJ/QlePCji1V/kzX/jts1BWx8MPN6bYWZekAiujet+O4W19Y3NreJ2aWd3b/+gfHjU1HGqGDZYLGLVDqhGwSU2DDcC24lCGgUCW8Hobua3xqg0j+WTmSToR3QgecgZNVZ6HPe8XrniVt05yCrxclKBHPVe+avbj1kaoTRMUK07npsYP6PKcCZwWuqmGhPKRnSAHUsljVD72fzUKTmzSp+EsbIlDZmrvycyGmk9iQLbGVEz1MveTPzP66QmvPEzLpPUoGSLRWEqiInJ7G/S5wqZERNLKFPc3krYkCrKjE2nZEPwll9eJc2LqndV9R4uK7XbPI4inMApnIMH11CDe6hDAxgM4Ble4c0Rzovz7nwsWgtOPnMMf+B8/gAKnI2k</latexit>

h12
<latexit sha1_base64="BoAJzsEU8/jDqbRJ8bLCN/JqUIQ=">AAAB7XicbVBNSwMxEJ2tX7V+VT16CRbBU9kUUY9FLx4r2A9ol5JNs21sNlmSrFCW/gcvHhTx6v/x5r8xbfegrQ8GHu/NMDMvTAQ31ve/vcLa+sbmVnG7tLO7t39QPjxqGZVqyppUCaU7ITFMcMmallvBOolmJA4Fa4fj25nffmLacCUf7CRhQUyGkkecEuuk1qif4dq0X674VX8OtEpwTiqQo9Evf/UGiqYxk5YKYkwX+4kNMqItp4JNS73UsITQMRmyrqOSxMwE2fzaKTpzygBFSruSFs3V3xMZiY2ZxKHrjIkdmWVvJv7ndVMbXQcZl0lqmaSLRVEqkFVo9joacM2oFRNHCNXc3YroiGhCrQuo5ELAyy+vklatii+r+P6iUr/J4yjCCZzCOWC4gjrcQQOaQOERnuEV3jzlvXjv3seiteDlM8fwB97nDywmjt4=</latexit>

<latexit sha1_base64="divmcn7cMkGD54tEnPYuQJlAg+0=">AAACA3icbVBNS8NAEN34WetX1JtegkWol5KIqMeiF48V7Ac0oWw223bpZjfsToQSCl78K148KOLVP+HNf+OmzUFbHww83pthZl6YcKbBdb+tpeWV1bX10kZ5c2t7Z9fe229pmSpCm0RyqToh1pQzQZvAgNNOoiiOQ07b4egm99sPVGkmxT2MExrEeCBYnxEMRurZh75MqMIglcAxzQCL4aTqk0jCac+uuDV3CmeReAWpoAKNnv3lR5KkMRVAONa667kJBBlWwAink7KfappgMsID2jU0X6iDbPrDxDkxSuT0pTIlwJmqvycyHGs9jkPTGWMY6nkvF//zuin0r4KMiSQFKshsUT/lDkgnD8SJmKIE+NgQTBQztzpkiBUmYGIrmxC8+ZcXSeus5l3UvLvzSv26iKOEjtAxqiIPXaI6ukUN1EQEPaJn9IrerCfrxXq3PmatS1Yx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dj8VoxSl3juEPnM8fJ8ORww==</latexit>

h0
<latexit sha1_base64="aJHGBeTkDmlcGJkLqMzFqj3Qd2A=">AAAB83icbVDLSsNAFL2pr1pfVZduBovgqiQi6rLoxmUF+4AmlMl00g6dTMLMjVBCf8ONC0Xc+jPu/BunbRbaemDgcM693DMnTKUw6LrfTmltfWNzq7xd2dnd2z+oHh61TZJpxlsskYnuhtRwKRRvoUDJu6nmNA4l74Tju5nfeeLaiEQ94iTlQUyHSkSCUbSS78cUR2GUj6Z9t1+tuXV3DrJKvILUoECzX/3yBwnLYq6QSWpMz3NTDHKqUTDJpxU/MzylbEyHvGepojE3QT7PPCVnVhmQKNH2KSRz9fdGTmNjJnFoJ2cZzbI3E//zehlGN0EuVJohV2xxKMokwYTMCiADoTlDObGEMi1sVsJGVFOGtqaKLcFb/vIqaV/Uvau693BZa9wWdZThBE7hHDy4hgbcQxNawCCFZ3iFNydzXpx352MxWnKKnWP4A+fzBxJkkbU=</latexit>

w2
<latexit sha1_base64="95hFdgw0mgDVo5h9Ql2bCn3lKW8=">AAAB83icbVDLSgMxFL2pr1pfVZdugkVwVWaKqMuiG5cV7AM6Q8mkmTY0kxmSjFKG/oYbF4q49Wfc+Tdm2llo64HA4Zx7uScnSATXxnG+UWltfWNzq7xd2dnd2z+oHh51dJwqyto0FrHqBUQzwSVrG24E6yWKkSgQrBtMbnO/+8iU5rF8MNOE+REZSR5ySoyVPC8iZhyE2dNs0BhUa07dmQOvErcgNSjQGlS/vGFM04hJQwXRuu86ifEzogyngs0qXqpZQuiEjFjfUkkipv1snnmGz6wyxGGs7JMGz9XfGxmJtJ5GgZ3MM+plLxf/8/qpCa/9jMskNUzSxaEwFdjEOC8AD7li1IipJYQqbrNiOiaKUGNrqtgS3OUvr5JOo+5e1t37i1rzpqijDCdwCufgwhU04Q5a0AYKCTzDK7yhFL2gd/SxGC2hYucY/gB9/gAsVZHG</latexit>

x1
<latexit sha1_base64="Y+2aeSrN4CX9NMjKhem4iKyb3ko=">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HGRGo0FWR5KDIc6QTlBaARk5RoPrMEE8lsVkQmWGKibU0VW4K3+uV10m3UvWbde7iqtW6LOspwBudwCR5cQwvuoQ0dIJDCM7zCm2OcF+fd+ViOlpxi5xT+wPn8ASlHkcQ=</latexit> <latexit sha1_base64="Y+2aeSrN4CX9NMjKhem4iKyb3ko=">AAAB83icbVBNS8NAFHypX7V+VT16WSyCp5KIqMeiF48VbC00pWy2L+3SzSbsbsQS+je8eFDEq3/Gm//GTZuDtg4sDDPv8WYnSATXxnW/ndLK6tr6RnmzsrW9s7tX3T9o6zhVDFssFrHqBFSj4BJbhhuBnUQhjQKBD8H4JvcfHlFpHst7M0mwF9Gh5CFn1FjJ9yNqRkGYPU37Xr9ac+vuDGSZeAWpQYFmv/rlD2KWRigNE1TrrucmppdRZTgTOK34qcaEsjEdYtdSSSPUvWyWeUpOrDIgYazsk4bM1N8bGY20nkSBncwz6kUvF//zuqkJr3oZl0lqULL5oTAVxMQkL4AMuEJmxMQSyhS3WQkbUUWZsTVVbAne4peXSfus7l3UvbvzWuO6qKMMR3AMp+DBJTTgFprQAgYJPMMrvDmp8+K8Ox/z0ZJT7BzCHzifPyxYkcY=</latexit>

where wn and un are the n-th rows of matrices, W and U, respectively.

Q2: The model parameters to be learned are b, W, U, v, and c.

Q3:
(1) The forward pass:
 
h11 = tanh w1> h0 + u> x
1 1 + b1 = tanh(1.7) = 0.9354
 
h12 = tanh w2> h0 + u> x
2 1 + b2 = tanh(−0.2) = −0.1974

o1 =(h11 v1 + h12 v2 ) + c = 1.0098


TrainLoss =(o1 − y1 )2 = 0.2403

1
(2) The backward pass:
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 = −0.9804
∂c
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · h11 = −0.9171
∂v1
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · h12 = 0.1935
∂v2
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · v1 · (1 − tanh2 (a1 )) · 1 = −0.0613
∂b1
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · v2 · (1 − tanh2 (a2 )) · 1 = −0.7538
∂b2
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · v1 · (1 − tanh2 (a1 )) · 1 · 1 · h0 = 0
∂w1
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · v2 · (1 − tanh2 (a2 )) · 1 · 1 · h0 = 0
∂w2
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · v1 · (1 − tanh2 (a1 )) · 1 · 1 · x1 = [−0.0613, 0.0613, −0.0613]
∂u1
∂ TrainLoss
=2 · (o1 − y1 ) · 1 · 1 · 1 · v2 · (1 − tanh2 (a2 )) · 1 · 1 · x1 = [−0.7538, 0.7538, −0.7538]
∂u2
Therefore, the gradient with respect to the model parameters are:
∇b TrainLoss =[−0.0613, −0.7538]>
 
0 0
∇W TrainLoss =
0 0
 
−0.0613 0.0613 −0.0613
∇U TrainLoss =
−0.7538 0.7538 −0.7538
∇v TrainLoss =[−0.9171, 0.1935]>
∇c TrainLoss = − 0.9804

Problem 2: Naïve Bayes Classifier


(a) Step 1. The prior probabilities are given by: p(Flu) = 0.29 and p(Healthy) = 0.71.
Step 2. The conditional probability of each feature is given by:

p(Fever = No|Flu) = 10/26 = 0.38,


p(Fever = No|Health) = 59/64 = 0.92,
p(Sore throat = Yes|Flu) = 19/26 = 0.73,
p(Sore throat = Yes|Health) = 10/64 = 0.16,

Step 3. Hence, for the person with sore throat but no fever, we have

p(Flu)p(Fever = No|Flu)p(Sore throat = Yes|Flu) ≈ 0.08

and
p(Healthy)p(Fever = No|Health)p(Sore throat = Yes|Health) ≈ 0.10.
Since 0.1 > 0.08, the naïve Bayes classifier will classify this person as Healthy.

(b) The advantages: (1) Naïve Bayes classifier is very fast. (2) the probability used in naïve Bayes
classifier can easily be updated when new training data comes in; therefore, it is very easy to
achieve incremental learning. (3) It is easy to implement.

2
The disadvantage: (1) It assumes that all features are independent, which may not align with real
datasets. (2) zero frequency problem: if a categorical feature has a value in test set that is not
observed in training set, naïve Bayes classifier will assign a zero probability and cannot make
predictions.

Problem 3: Q-Learning
(a) The values of (i-v) are 10, 0, 0, 0, and 10, respectively.
(b) The Q-table is initialized to all zeros as follows.

MoveSouth MoveEast MoveNorth MoveWest


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

In this example solution, we use η = 0.9 and γ = 1. It’s ok to use other values as long as you
explicitly state them in your solutions.
1) s = 1, a =MoveSouth, s0 = 3, r = 10.
 h i 
0 0
Q(1, MoveSouth) ← Q(s, a) + η r + γ max
0
Q(s , a ) − Q(s, a) = 0 + 0.9 × (10 + 0 − 0) = 9
a

MoveSouth MoveEast MoveNorth MoveWest


1 9 0
2 0 0
3 0 0
4 0 0

2) s = 3, a =MoveEast, s0 = 4, r = 0.
 h i 
0 0
Q(3, MoveEast) ← Q(s, a) + η r + γ max
0
Q(s , a ) − Q(s, a) = 0 + 0.9 × (0 + 0 − 0) = 0
a

3) s = 4, a =MoveNorth, s0 = 2, r = 0.
 h i 
0 0
Q(4, MoveNorth) ← Q(s, a) + η r + γ max
0
Q(s , a ) − Q(s, a) = 0 + 0.9 × (0 + 0 − 0) = 0
a

4) s = 2, a =MoveWest, s0 = 1, r = 0.
 h i 
0 0
Q(2, MoveWest) ← Q(s, a) + η r + γ max
0
Q(s , a ) − Q(s, a) = 0 + 0.9 × (0 + 1 × 9 − 0) = 8.1
a

5) s = 1, a =MoveEast, s0 = 3, r = 10.
 h i 
0 0
Q(1, MoveEast) ← Q(s, a) + η r + γ max
0
Q(s , a ) − Q(s, a) = 0 + 0.9 × (10 + 1 × 0 − 0) = 9
a

MoveSouth MoveEast MoveNorth MoveWest


1 9 9
2 0 8.1
3 0 0
4 0 0

Therefore, at the end of this phase, the nonzero entries of the Q-table are:
Q(1, MoveSouth) = 9, Q(1, MoveEast) = 9, Q(2, MoveWest) = 8.1

3
Problem 4: Markov Decision Process
(a) The transition function is defined as below.

s a s0 T(s, a, s0 )
S1 stay S1 0.8
S1 stay S2 0.2
S1 stay S3 0
S1 leave S1 0
S1 leave S2 0.5
S1 leave S3 0.5
S2 stay S1 0
S2 stay S2 0.8
S2 stay S3 0.2
S2 leave S1 0.9
S2 leave S2 0.1
S2 leave S3 0

Note: The rows with zero transition probability can be omitted.

(b) The reward function is defined as below.

s a s0 Reward(s, a, s0 )
S1 stay S1 $-2
S1 stay S2 $2
S1 leave S2 $3
S1 leave S3 $5
S2 stay S2 $1
S2 stay S3 $3
S2 leave S1 $-1
S2 leave S2 $2

(c) The steps of running the iterative algorithm are as below.


(0) (0) (0)
1) We initialized Vπ (S1) = 0, Vπ (S2) = 0, Vπ (S3) = 0, S3 is the end state, so Vπ (S3)
does not need to updated. Then, we follow the following iterative update rule.
X h i
Vπ(t) (s) ← T s, π(s), s0 Reward s, π(s), s0 + γVπ(t−1) s0


s0

2) t = 1:
Vπ(1) (S1) ← 0.5 × (3 + 1 × 0) + 0.5 × (5 + 1 × 0) = 4
Vπ(1) (S2) ← 0.8 × (1 + 1 × 0) + 0.2 × (3 + 1 × 0) = 1.4
2) t = 2:
Vπ(2) (S1) ← 0.5 × (3 + 1 × 1.4) + 0.5 × (5 + 1 × 0) = 4.7
Vπ(2) (S2) ← 0.8 × (1 + 1 × 1.4) + 0.2 × (3 + 1 × 0) = 2.52
2) t = 3:
Vπ(3) (S1) ← 0.5 × (3 + 1 × 2.52) + 0.5 × (5 + 1 × 0) = 5.26
Vπ(3) (S2) ← 0.8 × (1 + 1 × 2.52) + 0.2 × (3 + 1 × 0) = 3.416

You might also like