Skip to content

Commit 43eb7b8

Browse files
Merge pull request #1 from virtual-labs/dev
Dev
2 parents 0f0f629 + 80180bd commit 43eb7b8

20 files changed

+883
-45
lines changed

experiment-descriptor.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"unit-type": "lu",
3+
"label": "",
4+
"basedir": ".",
5+
"units": [
6+
{
7+
"unit-type": "aim"
8+
},
9+
{
10+
"target": "theory.html",
11+
"source": "theory.md",
12+
"label": "Theory",
13+
"unit-type": "task",
14+
"content-type": "text"
15+
},
16+
{
17+
"target": "objective.html",
18+
"source": "objective.md",
19+
"label": "Objective",
20+
"unit-type": "task",
21+
"content-type": "text"
22+
},
23+
{
24+
"target": "pretest.html",
25+
"source": "pretest.json",
26+
"label": "Pretest",
27+
"unit-type": "task",
28+
"content-type": "assesment"
29+
},
30+
{
31+
"target": "procedure.html",
32+
"source": "procedure.md",
33+
"label": "Procedure",
34+
"unit-type": "task",
35+
"content-type": "text"
36+
},
37+
{
38+
"target": "simulation.html",
39+
"source": "simulation/index.html",
40+
"label": "Simulation",
41+
"unit-type": "task",
42+
"content-type": "simulation"
43+
},
44+
{
45+
"target": "posttest.html",
46+
"source": "posttest.json",
47+
"label": "Posttest",
48+
"unit-type": "task",
49+
"content-type": "assesment"
50+
},
51+
{
52+
"target": "references.html",
53+
"source": "references.md",
54+
"label": "References",
55+
"unit-type": "task",
56+
"content-type": "text"
57+
}
58+
]
59+
}
60+

experiment/aim.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
### Aim of the experiment
1+
Sometimes solving a big problem may require us to solve smaller problems of similar nature. For example, computing the xth number in the fibonacci sequence may require us to find the x-1th and the x-2th numbers in the sequence. If we are able to break the main problem into smaller instances of the same problem again and again, so that eventually the smaller problems become trivial, then we can use the solutions to the trivial problems to progressively build bigger solutions. Consequently, we can reach the solution of our main problem. This concept when used in coding is called recursion.
2+
3+
For writing a recursive code for a problem, we simply call a function inside the definition of the same function. Thus the definition of GNU (the source of much free software) is said to be recursive because GNU stands for 'GNU's Not Unix', i.e. GNU is part of the definition of GNU! Or maybe two mirrors placed parallely! The nested images are a form of infinite recursion.
4+

experiment/experiment-name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
## Experiment name
1+
## Recursion

experiment/images/code1.png

4.82 KB
Loading

experiment/images/code3.png

4.32 KB
Loading

experiment/images/code4.png

4.15 KB
Loading

experiment/images/code5.png

4.85 KB
Loading

experiment/objective.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- To understand that some problems can be broken down into smaller similar problems.
2+
- To solve such problems using recursive procedures.

experiment/posttest.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
[
2-
{"question":"This is a Sample Question 1?",
2+
{"question":"1. What will be the ouptut of the following function call: fun3(100); where fun3 is defined as: <br/> <img src='images/code5.png'>",
33
"answers":{
4-
"a":"answer1",
5-
"b":"answer2",
6-
"c":"answer3",
7-
"d":"answer4"
4+
"a":"13",
5+
"b":"14",
6+
"c":"3",
7+
"d":"7"
88
},
9-
"correctAnswer":"a"},
10-
{"question":"This is a Sample Question 2?",
11-
"answers":{
12-
"a":"answer1",
13-
"b":"answer2",
14-
"c":"answer3",
15-
"d":"answer4"
16-
},
17-
"correctAnswer":"c"}
9+
10+
"correctAnswer":"a"}
11+
1812
]

experiment/pretest.json

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,43 @@
1-
[
2-
{"question":"This is a Sample Question 1?",
3-
"answers":{
4-
"a":"answer1",
5-
"b":"answer2",
6-
"c":"answer3",
7-
"d":"answer4"
8-
},
9-
"correctAnswer":"a"},
10-
{"question":"This is a Sample Question 2?",
11-
"answers":{
12-
"a":"answer1",
13-
"b":"answer2",
14-
"c":"answer3",
15-
"d":"answer4"
16-
},
17-
"correctAnswer":"c"}
1+
[{
2+
"question": "1. How many stars will the following code output for a given positive value of n: <br/> <img src='images/code1.png'>",
3+
"answers": {
4+
"a": "n",
5+
"b": "n^2",
6+
"c": "n(n-1)/2",
7+
"d": "n(n+1)/2"
8+
},
9+
"correctAnswer": "d"
10+
},
11+
12+
{
13+
"question": "2. For every recursive solution, there is a corresponding iterative solution?",
14+
"answers": {
15+
"a": "True",
16+
"b": "False"
17+
},
18+
"correctAnswer": "a"
19+
},
20+
21+
{
22+
"question": "3. What will be the ouptut of the following function call: fun2(20); where fun2 is defined as: <br/> <img src='images/code3.png'>",
23+
"answers": {
24+
"a": "20 40 60 80 60 40 20",
25+
"b": "80 60 40 20",
26+
"c": "20 40 60 80 80 60 40 20",
27+
"d": "20 40 60 80"
28+
},
29+
"correctAnswer": "c"
30+
},
31+
32+
{
33+
"question": "4. What will be the ouptut of the following function call: fun3(100); where fun3 is defined as: <br/> <img src='images/code4.png'>",
34+
"answers": {
35+
"a": "6",
36+
"b": "7",
37+
"c": "5",
38+
"d": "4"
39+
},
40+
"correctAnswer": "a"
41+
}
42+
1843
]

0 commit comments

Comments
 (0)