• edited by
1,072 views

4 Answers

Best answer
7 7 votes
Renaming isi1(x, y) as $f(x,y)$ where $x$ is float and $y$ is an integer.

Definition of $f(x,y)$ is given for $x \neq 0 $ as:

\[
    f(x,y)=
\begin{cases}
    1,& \text{ } y = 0\\
    f(x,-y),              & \text{} y > 0\\
    \frac{f(x,y+1)}{x},              & \text{}y < 0\\
\end{cases}
\]

Case 1: $y > 0$

$f(x, \ y) = f(x, \ -y) =  \frac{f(x, \  -y+1)}{x} = \frac{f(x, \ -y+2)}{x^2} = … = \frac{f(x, \ -y+a)}{x^a}$ for $a \geq 1$

So, $f(x,y) = \frac{f(x ,\ a \ – \ y)}{x^a} $

Since, base case is $f(x,0) = 1,$ So, $f(x ,\ a \ – \ y) = 1$ when $a \ – \ y = 0 \Rightarrow a = y$

Hence, $f(x,y) = \frac{1}{x^y} $ for $y > 0$

 

Case 2: $y < 0$

$f(x, \ y) = \frac{f(x, \ y+1)}{x} = \frac{f(x, \ y+2)}{x^2} = … = \frac{f(x, \ y+a)}{x^a}$ for $a \geq 1$

So, $f(x,y) = \frac{f(x ,\ a \ + \ y)}{x^a} $

Since, base case is $f(x,0) = 1,$ So, $f(x ,\ a \ + \ y) = 1$ when $a \ + \ y = 0 \Rightarrow a = \ - \ y$

Hence, $f(x,y) = \frac{1}{x^ { \ – \ y}} $ for $y < 0$

From case (1) and (2), $f(x,y) = \frac{1}{x^{|y|}} = x^ {\ – \ |y|}$

Hence, given function computes $x^ {\ – \ |y|} \  ; x \neq 0$
• selected by
1 1 vote

The function isil(x,y) returns 1 / ( x ^ |y| ) = x^( – |y| )

Refer  the following pic where dry run of 2 isil functions are shown.


 

 

• edited by
0 0 votes

 Answer is: function computes  \( x^{-|y|} \   when \  x \not = 0\)

Position:
Show:

Related questions

1 1 vote
3 3 answers
894
894 views
admin asked Aug 18, 2022
894 views
What will be the output of the following C program? Justify your answer. Negative numbers are represented in $2$'s complement,#include<stdio.h int main() { if (-~-1) prin...
0 0 votes
2 2 answers
850
850 views
admin asked Aug 8, 2022
850 views
You are given two sorted arrays $X[\;]$ and $Y[\;]$ of positive integers. The array sizes are not given. Accessing any index beyond the last element of the arrays returns...
1 1 vote
2 2 answers
775
775 views
admin asked Aug 8, 2022
775 views
Simplify the following Boolean function in product-of-sums form: $$ F(A, B, C, D)=\sum(0,1,2,5,8,9,10) . $$
1 1 vote
1 1 answer
629
629 views
admin asked Aug 25, 2022
629 views
Consider the following state diagram of a sequential circuit, where each of a, b, c, d, e, f and g represents a state. Represent thestate diagram with minimum number of s...