Skip to main content

Boats and Streams

Basic Concepts of Questions on Boats and Streams

  1. A boat is said to go downstream, if the boat goes in the direction of stream.
  2. A boat is said to go upstream, if the boat goes opposite to the direction of stream.

Basic Formulas

  1. If speed of boat in still water is b km/hr and speed of stream is s km/hr,
    • Speed of boat in downstream = (b  + s) km/hr , since the boat goes with the stream of water.
    • Speed of boat in upstream = (b  - s) km/hr. The boat goes against the stream of water and hence its speed gets reduced.

Shortcuts With Explanation

Scenario 1: Given a boat travels downstream with speed d km/hr and it travels with speed u km/hr upstream. Find the speed of stream and speed of boat in still water.
Let speed of boat in still water be bkm/hr and speed of stream be skm/hr.
Then b + s  = d and b – s = u.
Solving the 2 equations we get,
b = (d + u)/2
s = (d – u)/2

Scenario 2: A man can row a boat, certain distance downstream in td hours and returns the same distance upstream in tu hours. If the speed of stream is s km/h, then the speed of boat in still water is given by
We know distance = speed * time
Let the speed of boat be b km/hr
Case downstream:
    d = (b + s) * td
Case upstream:
    d = (b - s) * tu

=>    (b + s) / (b - s) = tu / td

b = [(tu + td) / (tu - td)] * s

Scenario 3: A man can row in still water at b km/h. In a stream flowing at  s km/h, if it takes him t hours to row to a place and come back, then the distance between two places, d is given by
Downstream:  Let the time taken to go downstream be td
    d = (b + s) * td

Upstream: Let the time taken to go upstream be tu
    d = (b - s) * tu

td + tu = t
[d / (b + s)] + [d / (b - s)] = t
So, d = t * [(b2 - s2) / 2b]
OR
d = [t * (Speed to go downstream) * (Speed to go upstream)]/[2 * Speed of boat or man in still water]

Scenario 4: A man can row in still water at b km/h. In a stream flowing at s km/h, if it takes t hours more in upstream than to go downstream for the same distance, then the distance d is given by
Time taken to go upstream = t + Time taken to go downstream
(d / (b - s)) = t + (d / (b + s))
=> d [ 2s / (b2 - s2 ] = t
So, d = t * [(b2 - s2) / 2s]
OR
d = [t * (Speed to go downstream) * (Speed to go upstream)] / [2 * Speed of still water]

Comments

Popular posts from this blog

ORACLE 9i practice solutions

Created by BCL easyConverter SDK 3 (HTML Version)

Zoho Puzzle Questions With Answers

Measuring Time Logic Puzzle You are given with two ropes with variable width. However if we start burning both the ropes, they will burn at exactly same time i.e. an hour. The ropes are non-homogeneous in nature. You are asked to measure 45 minutes by using these two ropes.

How can you do it?

Please note that you can’t break the rope in half as it is being clearly stated that the ropes are non-homogeneous in nature.
Answer & Explanation Solution: 45 minutes

Explanation :
All you have to do is burn the first rope from both the ends and the second rope from one end only simultaneously. The first rope will burn in 30 minutes (half of an hour since we burned from both sides) while the other rope would have burnt half. At this moment, light the second rope from the other end as well. Where, the second rope would have taken half an hour more to burn completely, it will take just 15 minutes as we have lit it from the other end too.

Thus you have successfully calculated 30+15 = 45 minutes …

Hackerrank > SQL > Basic Select

Select
01-Select All
Given a City table, whose fields are described as +-------------+----------+ | Field       | Type     | +-------------+----------+ | ID          | int(11)  | | Name        | char(35) | | CountryCode | char(3)  | | District    | char(20) | | Population  | int(11)  | +-------------+----------+
write a query that will fetch all columns for every row in the table.

My Solution
SELECT*FROM city;
---------------------------------------------------------------------------------
02-Select by ID
Given a City table, whose fields are described as