Skip to main content
11 events
when toggle format what by license comment
S Feb 2, 2015 at 4:27 history suggested Lola CC BY-SA 3.0
This is what I originally wrote. I corrected the typos.
Feb 2, 2015 at 2:54 comment added Lola So the function of n I wanted is f[n,\floor{n/5}] (using the definition of f[n,t] given above).
Feb 2, 2015 at 2:51 comment added Lola I wanted to have an efficient way of defining this function. Something that would work when the range is much larger or the conditional more complicated.
Feb 2, 2015 at 2:47 review Suggested edits
S Feb 2, 2015 at 4:27
Feb 2, 2015 at 2:45 comment added Lola No, f as I wrote it, is a function of n alone. In order to define it, I used the auxiliary variable t. In other words, what I wrote means: f[n]=0 if 0<=n<2, f[n]=1 if 3<=n<=4, f[n]=4 if 5<=n<=7, f[n]=5 if 8<=n<=9, f[n]=8 if 10<=n<=12, etc
Feb 1, 2015 at 22:01 comment added mgamer f depends on two variables.
Feb 1, 2015 at 21:32 vote accept Lola
Feb 2, 2015 at 15:34
Feb 1, 2015 at 21:31 comment added Lola I guess you can solve for t in terms of n and plug it in the function f[n,t], so I guess this will do it in this particular example. However, I am still curious on how would one define a function of n without solving for t. This will allow for a more complicated condition instead of 5t<=n<=5t+3...
Feb 1, 2015 at 21:12 comment added Lola Thanks! This is useful. The only thing is that I would really need a function f of n alone, without keeping track of the t.
Feb 1, 2015 at 21:07 vote accept Lola
Feb 1, 2015 at 21:09
Feb 1, 2015 at 18:49 history answered k_v CC BY-SA 3.0