Computer Science, asked by barinder2600065, 5 months ago

Christine's Sense of Direction
#include<stdio
#include<strir
// Read only r
4
Christine is on a hiking trip to a mountain. She decided to return to her town by a canoe.
She is good in canoeing, but not so good with directions. The river originates from the
glacier from where Christine will also start her trip. The river flows a distance M kilometers
before it splits into two smaller rivers. Each of these rivers further travels another M
kilometers distance before they split.
There are towns at the points where the rivers split. The towns are numbered. The river first
splits at town 1. Every town downstream from town v, is numbered 2*v (left) and 2*v+1
(right). Christine knows the location of her town is Q and has started canoeing. After
traveling a certain distance, she realized that she was on the wrong route for the past K
kilometers. If she is currently at town P, how much distance does she have to row now to
reach her town?
Note: The rivers only split and never merge.
Input Specification
input1: M the distance between adjacent towns.
input2: P the town Christine is at now.
input3: Q her home town
Output Specification
The total distance she has to travel to reach her home town.

Answers

Answered by reetuchauhan13022004
0

Answer:

Answer:

The solution is (x, y) = (- 13, 46)

Step-by-step explanation:

Substitution Method :-

Solve one of the equations for either x = or y = .

Substitute the solution from step 1 into the other equation.

Solve this new equation.

Solve for the second variable.

Step 1: Solve one of the equations for either x = or y = .

Given equations are 3x+2y=53 and 2x+3y=47

3x+2y=53 ................................................. ( 1 )

2x+3y=47 ..................................................( 2 )

Step 1: Solve one of the equations for either x = or y = . We will solve first equation for y.

3x + 2y = 53

subtract 3x from the sides of above equation,

2y = 53 - 3x

y = \frac{53 - 3x}{2}

2

53−3x

Step 2: Substitute the solution from step 1 into the second equation.

Put value of y in equation (2),

2x + 3y = 47

2x + 3 (\frac{53 - 3x}{2}

2

53−3x

) = 47

2x + (\frac{159 - 9x}{2}

2

159−9x

) = 47

Step 3: Solve this new equation.

Multiply by 2 on both the sides in above equation,

4x + 159 - 9x = 94

159 - 5x = 94

subtract by 159 on both the sides in above equation,

159 - 5x -159 = 94 - 159

- 5x = 65

divide both the sides by -5 in above equation,

x = - 13

Step 4: Solve for the second variable

Put x = - 13 in y = \frac{53 - 3x}{2}

2

53−3x

y\,=\,\frac{53 + 39}{2}y=

2

53+39

y\,=\,\frac{92}{2}y=

2

92

y\,=\,46y=46

The solution is: (x, y) = (- 13, 46)

Answered by Raghav1330
0

The answer is:(x, y) = (-13,46)

Given:

1. The river flows a distance of M kilometers before it splits into two smaller rivers.

2. There are towns at the points where the rivers split. The towns are numbered. The river first splits at town 1. Every town downstream from town v is numbered 2x(V) (left) and 2x(V+1).

3. A: M the distance between adjacent towns.

 B: P the town Christine is at now.

 C: Q her hometown

To find The total distance she has to travel to reach her home town.

Solution:

Substitution Method:-

Solve one of the equations for X or Y

Replace the solution from 1st step with the other equation.

Solve the new equation.

Solve for the second variable.

Step 1: Solve one of the equations for either x or y

Given equations are

3x+2y=53 and 2x+3y=47

3x+2y=53 ................................................. ( 1 )

2x+3y=47 ..................................................( 2 )

Step 1: Solve one of the equations for X or Y. We must solve the 1st equation for y.

3x + 2y = 53

subtract 3x from the sides of the above equation,

2y = 53 - 3x

y=(53-3x)/2

Step 2: Put the solution from 1st step into the 2nd equation.

replace the value of y in equation (2),

2x + 3y = 47

2x + 3(53-3x)/2=47

Step 3: Solve the latest equation.

Multiply by 2 on both the sides of the latest equation,

4x + 159 - 9x = 94

159 - 5x = 94

subtract by 159 on both sides in the above equation,

159-5x -159 =94-159

- 5x = 65

divide both the sides by (-5)in the above equation,

x = - 13

Step 4: Solve the second variable x=(-13)

The answer is:(x, y) = (-13,46)

#SPJ2

Similar questions