Please post your solution to the May 11 In-Class execise to this thread.
Best,
Chris
ANS: 50, 55, 70, 82, 99
SOL:
'''50''' < 51 < '''55''' <= '''50 * 1.1'''
'''70''' < 71 < '''70 * 1.1'''
'''82''' < 83 < 84 < '''82 * 1.1'''
(Edited: 2022-05-11)Given L = {50, 51, 55, 70, 71, 82, 83, 84, 99} and delta = 0.1:
L' = {50}, last = 50
y[2] = 51 -> 51 <= 50 * (1 + 0.1) = 55 -> skip 51
y[3] = 55 -> 55 <= 50 * (1 + 0.1) = 55 -> skip 55
y[4] = 70 -> 70 > 50 * (1 + 0.1) = 55 -> L' = {50, 70}, last = 70
y[5] = 71 -> 71 <= 70 * (1 + 0.1) = 77 -> skip 71
y[6] = 82 -> 82 > 70 * (1 + 0.1) = 77 -> L' = {50, 70, 82}, last = 82
y[7] = 83 -> 83 <= 82 * (1 + 0.1) = 90.2 -> skip 83
y[8] = 84 -> 84 <= 82 * (1 + 0.1) = 90.2 -> skip 84
y[9] = 99 -> 99 > 82 * (1 + 0.1) = 90.2 -> L' = {50, 70, 82, 99}, last = 99
The trimmed list is L' = {50, 70, 82, 99}.
Input List L = <50,51,55,70,71,82,83,94,99>
= 0.1
L = <50> 50 * 1.1 = 55, skip 51 and 55
L = <50, 70> 70 * 1.1 = 77, skip 71
L = <50, 70, 82> 82 * 1.1 = 90.2, skip 82, 83, 84
L = <50, 70, 82, 99> <50, 70, 82, 99>
Elements within (1+) factor of list elements = 51, 55, 71, 83, 84. we can remove them from the list, keeping the rest in the list.
Trimmed list L' = <50,70,82,99>
(Edited: 2022-05-16)L = <50>
50 * 1.1 = 55, skipping 51 and 55
L = <50, 70>
70 * 1.1 = 77, skipping 71
L = <50, 70, 82>
82 * 1.1 = 90.2, skipping 82, 83, 84
L = <50, 70, 82, 99>
<50, 70, 82, 99>
(Edited: 2022-05-11)<pre> [50, 51, 55, 70,71, 82, 83, 84, 99] {50}
51, 55 <= 55 (50*1.1) Skip 51, 55 {50, 70}
71 <= 77 (70*1.1) Skip 71 {50, 70, 82}
83, 84 <= 90.2 (82*1.1) skip 83, 84 {50, 70, 82, 99} </pre>
(Edited: 2022-05-11)<pre> L = {50, 51, 55, 70, 71, 82, 83, 84, 99}
50/1.1 = 45.45, L = {} so this doesnt satisfy the condition. 51/1.1 = 46.36, L = {50} so this does satisfy the condition. 55/1.1 = 50, L = {50} so this does satisfy the condition. 70/1.1 = 63.63, L = {50} so this doesnt satisfy the condition. 71/1.1 = 64.54, L = {50, 70} so this does satisfy the condition. 82/1.1 = 74.54, L = {50, 70} so this doesnt satisfy the condition. 83/1.1 = 75.45, L = {50, 70, 82} so this does satisfy the condition. 84/1.1 = 76.36, L = {50, 70, 82} so this does satisfy the condition. 99/1.1 = 90, L = {50, 70, 82} so this doesnt satisfy the condition.
L = {50, 70, 82, 99} </pre>
(Edited: 2022-05-11)<pre> [50, 51, 55, 70,71, 82, 83, 84, 99] <50>
51, 55 <= (50*1.1) = 55 Skip 51, 55 <50, 70>
71 <= (70*1.1)=77 Skip 71 <50, 70, 82>
83, 84 <= (82*1.1) 90.2 skip 83, 84 <50, 70, 82, 99> </pre>
L = {50, 51, 55, 70, 71, 82, 83, 84, 99} <br><br> delta= 0.1, delta+1 = 1.1<br><br> 50/1.1 = 45.45 -> L' = {} <br> 51/1.1 = 46.36 -> L' = {50} <br> 55/1.1 = 50 -> L' = {50} <br> 70/1.1 = 63.63 -> L' = {50}<br> 71/1.1 = 64.54 -> L' = {50, 70}<br> 82/1.1 = 74.54 -> L' = {50, 70} <br> 83/1.1 = 75.45 -> L' = {50, 70, 82} <br> 84/1.1 = 76.36 -> L' = {50, 70, 82} <br> 99/1.1 = 90 -> L' = {50, 70, 82} <br><br> Therefore L' = {50, 70, 82, 99}
(Edited: 2022-05-11)