The Gateway to Computer Science Excellence

First time here? Checkout the FAQ!

x

+27 votes

Suppose you want to move from $0$ to $100$ on the number line. In each step, you either move right by a unit distance or you take a *shortcut*. A shortcut is simply a pre-specified pair of integers $i,\:j \:\text{with}\: i <j$. Given a shortcut $(i,j)$, if you are at position $i$ on the number line, you may directly move to $j$. Suppose $T(k)$ denotes the smallest number of steps needed to move from $k$ to $100$. Suppose further that there is at most $1$ shortcut involving any number, and in particular, from $9$ there is a shortcut to $15$. Let $y$ and $z$ be such that $T(9) = 1 + \min(T(y),T(z))$. Then the value of the product $yz$ is _____.

+24 votes

Best answer

$T(k)$ is the smallest number of steps needed to move from $k$ to $100$.

Now, it is given that $y$ and $z$ are two numbers such that,

$T(9) = 1 + min (T(y), T(z))$ , i.e.,

$T(9) = 1 + min ($Steps from $y$ to $100$, Steps from $z$ to $100)$, where $y$ and $z$ are two possible values that can be reached from $9$.

One number that can be reached from $9$ is $10$, which is the number obtained if we simply move one position right on the number line. Another number is $15$, the shortcut path from $9$, as given in the question. So, we have two paths from $9$, one is $10$ and the other is $15$.

Therefore, the value of $y$ and $z$ is $10$ and $15$ (either variable may take either of the values).

Thus, $yz = 150$.

Now, it is given that $y$ and $z$ are two numbers such that,

$T(9) = 1 + min (T(y), T(z))$ , i.e.,

$T(9) = 1 + min ($Steps from $y$ to $100$, Steps from $z$ to $100)$, where $y$ and $z$ are two possible values that can be reached from $9$.

One number that can be reached from $9$ is $10$, which is the number obtained if we simply move one position right on the number line. Another number is $15$, the shortcut path from $9$, as given in the question. So, we have two paths from $9$, one is $10$ and the other is $15$.

Therefore, the value of $y$ and $z$ is $10$ and $15$ (either variable may take either of the values).

Thus, $yz = 150$.

0

""T(9)=1+min(T(9)=1+min(Steps from yy to 100100, Steps from zz to 100)100),__ where y and z are two possible values that can be reached from 9__." Where it is mentioned???

0

I am unable to find out how it,"__ where y and z are two possible values that can be reached from 9__", is linked. Can you please explain where it is ?

+1

T(9)=

1+min(T(y),T(z))

@rahulgargnov4 here the 1 in the equation is telling that. Equation says calculate minimum of T(y) and T(z) and then simply add 1 to it. What does that mean? 9 is at a distance of 1 from both y and z.

Analogy : height of the tree is : 1 + height(left) + height (right). Why one is here? because root is at distance one from both right and left.

+31 votes

$T(9) =$ Distance from $9$ to $100$

$T(9)=1+ \min(T(y),T(z))=1+$min(Distance from $y$ to $100$ , Distance from $z$ to $100$)

There are only two such values where we can reach from $9$ , one is simple step to right on number line , i.e $10$ and another is $15$ (given shortcut)

Hence , $y=10$ , $z=15$

$yz=10 \times 15 = 150$

$T(9)=1+ \min(T(y),T(z))=1+$min(Distance from $y$ to $100$ , Distance from $z$ to $100$)

There are only two such values where we can reach from $9$ , one is simple step to right on number line , i.e $10$ and another is $15$ (given shortcut)

Hence , $y=10$ , $z=15$

$yz=10 \times 15 = 150$

+2

it is solved like this

T(1)=1+min(T(y),T(z))=1+1=2

T(2)=1+min(T(y),T(z))=1+2=3

T(3)=1+min(T(y),T(z))=1+3=4

.

.

.

T(9)=10

Now, shortcut for T(9)=15

So, yz=10*15=150

but how could it be say , it goes from 0 to 100?

@ Srinath

- All categories
- General Aptitude 1.6k
- Engineering Mathematics 7.5k
- Digital Logic 3k
- Programming & DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6k
- Compiler Design 2.1k
- Databases 4.2k
- CO & Architecture 3.5k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.5k
- Admissions 585
- Exam Queries 572
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,126 questions

53,251 answers

184,758 comments

70,502 users