edited by
528 views

3 Answers

Best answer
5 votes
5 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 votes
1 votes

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

Related questions

1 votes
1 votes
1 answer
1
admin asked Aug 18, 2022
440 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...
1 votes
1 votes
1 answer
3
admin asked Aug 8, 2022
422 views
Simplify the following Boolean function in product-of-sums form: $$ F(A, B, C, D)=\sum(0,1,2,5,8,9,10) . $$
0 votes
0 votes
0 answers
4
admin asked Aug 25, 2022
300 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...