Computer Science, asked by aryabapun89, 2 months ago

Sara is trying a new type of game in which she can jump in either the left direction or in the right direction. Also after each jump the range of her jump increases by 1 unit. i.e if starts from 1 in the next jump she has to jump 2 units then 3 units and so on.
Given the number of jumps as N, the range of the first jump to be 1. What will be the minimum distance Sara can be at from the starting point.

Answers

Answered by amitnrw
0

Given :  Sara is trying a new type of game in which she can jump in either the left direction or in the right direction.

Also after each jump the range of her jump increases by 1 unit. ie if starts from 1 in the next jump she has to jump 2 units then 3 units and

so on.

Given the number of jumps as N the range of the first jump to be 1.

To Find : What will be the minimum distance Sara can be at from the starting point​

Solution:

minimum distance Sara can be at from the starting point​ = 0 or  1  depending upon value of  N

if jumps are 4m - 1   or 4m  then 0   other wise 1

for (4m - 1) and 4m jumps total distance = (4m - 1)*2m  or  2m(4m + 1)  hence even distance  so sara can jump half to left and half to right amd making it zero

for other cases  total distance = odd  hence  she will be minimum at a distance of 1

1  jump   minimum distance = 1

2 jump    1 left + 2 right = 1  right

3 jump     1 left + 2 left + 3 right = 0

4  jump     1 left + 2 right  + 3 right + 4 left = 0  

and maximum distance can be N(N+1)/2

Minimum distance from starting point :

Value of N =  4m- 1, 4m   then 0

N = 4m -2 , 4m - 3  then  1

Learn More:

SUBJECT:MATHEMATICSQ1. The Jumping FrogDescription :1 ...

brainly.in/question/10348409

A frog in a well is 12m below the ground level. If it jumps 5m and ...

https://brainly.in/question/36507984

Similar questions