#please helpp

26 messages · Page 1 of 1 (latest)

olive oarBOT
gloomy token
#

I'm not 100% on this at all but I think I understand

#

Which part don't you get

gloomy token
#

right, so i think part 1 is saying,
Consider the set {1,2,3,4,5}
give me a subset, of length 3, which doesnt have any 2 consecutive integers

#

so, 1,2,4 is not allowed

#

as 1 and 2 are consecutive

#

but 1,3,5 is

#

i think its the only one actually

#

now the function U(n, k) is asking how many of these subsets we can actually make which follow that rule

#

so for U(5,3) [our part 1] the answer is 1

#

so for U(n, 1) , we can only choose one number from our set,
there are n numbers to choose from so the answer is just n

#

U(n,1)=n

#

for U(n,2) i think its a lil trickier

#

lmk if you follow so far

static nest
#

For U(n,2) how we do

#

@gloomy token

gloomy token
#

Okay, for u(n,2) I think we may need to try some cases.
If n =2, then we have no solutions, as both would have to be chosen, but since they're consecutive wouldn't be allowed

#

If n=3, U(n,2) = 1, the only solution is 1,3

#

If n=4 U(n, 4) = 3
1,3 2,4 1,4

#

Let's try one more

#

N= 5, u(n, 5)
1,3 1,4 1,5 2,4 2,5 3,5
=6

#

Think you can go from here?

static nest
#

Thanks a lot

#

You are the goat

gloomy token
#

Np

supple kettle
#

.solved