0
$\begingroup$

The question goes something like this:
Give a recursive definition for the following set $S$: The set of ordered pairs $(a,b)$ where $a$ and $b$ are both positive integers and $a + b$ is odd.

In order to solve this, I first had to create a recursive case for odd and even numbers as follows.

$Q(1) = 1 || Q(N) = (Q(n-1)) + 2, N > 1$ //this gives all our positive odd values
$R(2) = 2 || R(N) = (R(n-1)) + 2, N > 2$ // this gives all our positive even values
If $x$ is in set $Q$, and $y$ is in set $R$, then $(x,y)$ is in $S$ and $(y,x)$ is in $S$

Would this be correct, and is there a different way I Should be doing this? I see that this question was asked here, however their approach was different than mine and I'm not entirely sure that I understand how they are doing it.

$\endgroup$
0
1
$\begingroup$

The difference between your approach and that other one is that you recursively define the sets of odd integers Q, you recursively define the set of even integers R, and then you finally define S (non-recursively) over Q and R, while that other approach has just one immediate recursive definition of S.

The question is: does your approach count as a recursive definition of S? Well, you have recursive definitions of Q and R on which your definition of S is based, but that last step of creating R from Q and R is non-recursive, so I wouldn't count your definition as a recursive definition. It is easier to create S the way you do, yes, but I don't think it can be considered recursive.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.