Grrr. anyone?

I’ve managed to extrapolate the problem I’ve been working on for three hours from its context:

Now, the obvious way to do it would be to create an enumeration of 2-tuples that contain a member of X and an enumeration of its targets in Y, then to extract the tuples that belong in A and discard all but the first member of the enumeration part of the tuple. But that’s just what they’d be expecting me to do. (joke) I know there’s a more elegant way. I just can’t find it. Winner gets a banana . . . through UPS five-day ground.

hah to the banana thing…

Anyways…

It sounds evaluating for y along a subset of x (a) and excluding any repeating results to form the sequence (s)

For instance y= (x-5)^2

x------y
0 ---- 25
1 ---- 16
2 ----- 9
3 ----- 4
4 ----- 1
5 ----- 0
6 ----- 1

back up to 25… the parabola was the only function I could think of that demostrates repeating numbers.

So subset A = 0 to 10
Y then equals 25,16,9,4,1,0,1,4,9,16,25
remove the dupes
S= {25,16,9,4,1,0}

I think anyways… they definitely made it wordy enough for me to not trust my perception of the problem. That’s all the sense I could make of it.

Oh this is a programming question lol… That changes things

1 Like

Alright so function f… as conditional as it may be…

I don’t know python so I won’t have the syntax right…

Create a tuple for the x values over the range of A…
Create an empty array to contain the results
Create a loop which evaluates function F from the first entry of x to the end of whatever length a is defined to be…(the array’s dimension)
Then when you go to store that result in the array (tuple, list, whatever)… you cross reference over previous entries to see if it is a duplicate…

Then you create a third array it sounds to contain S the reduced set.

They’re making you jump through a few hoops.

1 Like

They want A to still map to S… that’s weird part… hah…

I hope anything I said was of any help at all…

I’d make a 2 dimensional array for S one to hold the address of the corresponding A value and one that holds the result…

Again I don’t know python… so I don’t really know what mapping is…

1 Like

This has been a long time, let me embarrass myself :slight_smile:

create the tuple A’ - the enumeration of A. Let S be the tuple such that [s_i]:=f(a_i), for a in A’, iff f(a_i) does not equal f(a_k) for all k smaller than i.

1 Like

That seems to work. I guess I’ll have to get my own damned banana. It took another hour after posting this to get it, after I gave up on the notion of doing it in a non-iterative way.

1 Like

Congrats rockwell!