From 133d1136e4e516b99450377ff78c77ef4cd56021 Mon Sep 17 00:00:00 2001 From: ATMAKURISRICHARAN <67268956+ATMAKURISRICHARAN@users.noreply.github.com> Date: Wed, 24 Jun 2020 22:56:09 +0530 Subject: [PATCH 1/6] updated broken link --- src/lab/exp9/Manual.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lab/exp9/Manual.html b/src/lab/exp9/Manual.html index 20acbb4b..ed6a691f 100644 --- a/src/lab/exp9/Manual.html +++ b/src/lab/exp9/Manual.html @@ -43,7 +43,7 @@ - + @@ -215,4 +215,4 @@

Follow Us

- \ No newline at end of file + From b06050c669a31614e2cc8c5d9927abdd824bc259 Mon Sep 17 00:00:00 2001 From: ATMAKURISRICHARAN <67268956+ATMAKURISRICHARAN@users.noreply.github.com> Date: Wed, 24 Jun 2020 23:37:16 +0530 Subject: [PATCH 2/6] Update Experiment.html --- src/lab/exp9/Experiment.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lab/exp9/Experiment.html b/src/lab/exp9/Experiment.html index 2fec8e42..86fea072 100644 --- a/src/lab/exp9/Experiment.html +++ b/src/lab/exp9/Experiment.html @@ -43,7 +43,7 @@ - + @@ -215,4 +215,4 @@

Follow Us

- \ No newline at end of file + From 68c24b1855e86edbd1dd6a75112089f4a782e6eb Mon Sep 17 00:00:00 2001 From: ATMAKURI SRICHARAN Date: Sun, 28 Jun 2020 17:28:19 +0530 Subject: [PATCH 3/6] assignment --- src/lab/exp9/Theory.html | 241 --------------------------- src/lab/exp9/{theory.html => t.html} | 0 2 files changed, 241 deletions(-) delete mode 100644 src/lab/exp9/Theory.html rename src/lab/exp9/{theory.html => t.html} (100%) mode change 100755 => 100644 diff --git a/src/lab/exp9/Theory.html b/src/lab/exp9/Theory.html deleted file mode 100644 index 61e20e4f..00000000 --- a/src/lab/exp9/Theory.html +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - Welcome to Virtual Labs - A MHRD Govt of india Initiative - - - - - - - - - - - - - - - - - - -
-
- - -
- -
-
-
-
-
-
- - - -
-

Computer Science & EngineeringProblem Solving Lab →List Of Experiments

- -
- - -
- - -

Permutations

-

Problem 1

-
-

- Recursion can be applied to a problem if the problem for the given input can be expressed as dependent upon the solution of the same problem for simpler inputs. One has to hardcode the solution for some simple cases, so that this recursion does not go on endlessly. Now, the given problem of expressing a weight(W) as a sum of other weights can be expressed as the problem of choosing one weight(w) such that it is not greater than W and then solving the same problem for the remaining weight W-w. For this particular problem, the solution can be expressed easily by choosing all the weight(w) as the first weights one by one, also taking care the the total weight(S) is not greater than reqired weight W. Those weights which make the total weight(S) greater than W are exluded from the list of avaliable weights for the next recursive. Now we only have to solve the same problem for a simpler case to get the complete solution, i.e., solving the same problem for the remaining weight, W-w, and available pool of weights now also does not have w. If accumulated weight is equal to w, then we increment the counter. If at any time, the pool of remaining weights is exhausted, then that attempt is aborted. So, our recursion function would be needing 2 variables, one containing the list of available weights and the other signifying remaining weight to be accrued. - -

-

-
-

Problem 2

-
-

- For each weight in the input we keep it on right pan and try using other weights to balance it. Let us say we have kept ith weight on the right pan, out task is now to keep weights on left side of the pan so that the sum of the weights on left side of the pan is equal to the weight on the right side,i.e weight[i]. For each weight W[k], we can keep it either on left pan or we donot to keep it at all. Make sure to disregard the weight when k is equal to i because that weight is already on right side. -

-

Recursive formulation

-

- Let F(index,i,S) denotes the number of ways in which we can obtain weight[i] using weights from weight[index], weight[index+1], weight[index+2],..., weight[n-1] and currently because of choosing some weights from weight[0], weight[1],..., weight[index-1] the sum of the weights has become S. So we need to achieve weight[i]-S by choosing some weights from weight[index], weight[index+1],..., weight[n-1]. -

-

- A pseudo code would look like:
- - F(index,i,S) = F(index+1,i,S) If index=i
- = 1 If index=N and S=weight[i]
- = 0 If index=N and S!=weight[i]
- = F(index+1,i,S+weight[index])+F(index+1,i,S) otherwise
-

-

-
-
-
- - - - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/lab/exp9/theory.html b/src/lab/exp9/t.html old mode 100755 new mode 100644 similarity index 100% rename from src/lab/exp9/theory.html rename to src/lab/exp9/t.html From 15dd64efc0b6e26ce3d45d05845f6ef36cbc759a Mon Sep 17 00:00:00 2001 From: ATMAKURI SRICHARAN Date: Sun, 28 Jun 2020 17:51:19 +0530 Subject: [PATCH 4/6] broken line --- src/lab/exp8/Experiment.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lab/exp8/Experiment.html b/src/lab/exp8/Experiment.html index a8363f90..b4955324 100644 --- a/src/lab/exp8/Experiment.html +++ b/src/lab/exp8/Experiment.html @@ -43,7 +43,7 @@ - + From f1a42ce65a26c299646dbd542b76bb5d63345754 Mon Sep 17 00:00:00 2001 From: ATMAKURI SRICHARAN Date: Sun, 28 Jun 2020 17:55:17 +0530 Subject: [PATCH 5/6] broken line --- src/lab/exp8/Experiment.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lab/exp8/Experiment.html b/src/lab/exp8/Experiment.html index b4955324..3a16fee4 100644 --- a/src/lab/exp8/Experiment.html +++ b/src/lab/exp8/Experiment.html @@ -43,7 +43,7 @@ - + From 93fbfc49bc995eb1428f5cf6ea3d2083b293ef4a Mon Sep 17 00:00:00 2001 From: ATMAKURI SRICHARAN Date: Sun, 28 Jun 2020 18:26:12 +0530 Subject: [PATCH 6/6] Revert "assignment" This reverts commit 68c24b1855e86edbd1dd6a75112089f4a782e6eb. --- src/lab/exp9/Theory.html | 241 +++++++++++++++++++++++++++ src/lab/exp9/{t.html => theory.html} | 0 2 files changed, 241 insertions(+) create mode 100644 src/lab/exp9/Theory.html rename src/lab/exp9/{t.html => theory.html} (100%) mode change 100644 => 100755 diff --git a/src/lab/exp9/Theory.html b/src/lab/exp9/Theory.html new file mode 100644 index 00000000..61e20e4f --- /dev/null +++ b/src/lab/exp9/Theory.html @@ -0,0 +1,241 @@ + + + + + + + + + + Welcome to Virtual Labs - A MHRD Govt of india Initiative + + + + + + + + + + + + + + + + + + +
+
+ + +
+ +
+
+
+
+
+
+ + + +
+

Computer Science & EngineeringProblem Solving Lab →List Of Experiments

+ +
+ + +
+ + +

Permutations

+

Problem 1

+
+

+ Recursion can be applied to a problem if the problem for the given input can be expressed as dependent upon the solution of the same problem for simpler inputs. One has to hardcode the solution for some simple cases, so that this recursion does not go on endlessly. Now, the given problem of expressing a weight(W) as a sum of other weights can be expressed as the problem of choosing one weight(w) such that it is not greater than W and then solving the same problem for the remaining weight W-w. For this particular problem, the solution can be expressed easily by choosing all the weight(w) as the first weights one by one, also taking care the the total weight(S) is not greater than reqired weight W. Those weights which make the total weight(S) greater than W are exluded from the list of avaliable weights for the next recursive. Now we only have to solve the same problem for a simpler case to get the complete solution, i.e., solving the same problem for the remaining weight, W-w, and available pool of weights now also does not have w. If accumulated weight is equal to w, then we increment the counter. If at any time, the pool of remaining weights is exhausted, then that attempt is aborted. So, our recursion function would be needing 2 variables, one containing the list of available weights and the other signifying remaining weight to be accrued. + +

+

+
+

Problem 2

+
+

+ For each weight in the input we keep it on right pan and try using other weights to balance it. Let us say we have kept ith weight on the right pan, out task is now to keep weights on left side of the pan so that the sum of the weights on left side of the pan is equal to the weight on the right side,i.e weight[i]. For each weight W[k], we can keep it either on left pan or we donot to keep it at all. Make sure to disregard the weight when k is equal to i because that weight is already on right side. +

+

Recursive formulation

+

+ Let F(index,i,S) denotes the number of ways in which we can obtain weight[i] using weights from weight[index], weight[index+1], weight[index+2],..., weight[n-1] and currently because of choosing some weights from weight[0], weight[1],..., weight[index-1] the sum of the weights has become S. So we need to achieve weight[i]-S by choosing some weights from weight[index], weight[index+1],..., weight[n-1]. +

+

+ A pseudo code would look like:
+ + F(index,i,S) = F(index+1,i,S) If index=i
+ = 1 If index=N and S=weight[i]
+ = 0 If index=N and S!=weight[i]
+ = F(index+1,i,S+weight[index])+F(index+1,i,S) otherwise
+

+

+
+
+
+ + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/lab/exp9/t.html b/src/lab/exp9/theory.html old mode 100644 new mode 100755 similarity index 100% rename from src/lab/exp9/t.html rename to src/lab/exp9/theory.html