text:
# All Questions

29,234 questions
7 views

### Difference between present - absent bit and valid - invalid bit in a page table?

while reading I found this: Present/Absent bit – Present or absent bit says whether a particular page you are looking for is present or absent. In case if it is not present, that is called Page ...
31 views

### Length of shortest codeword in Huffman encoding

Under Huffman Encoding, if one character occurs more than 1/3rd of the time, is it guaranteed that there will be at least one character whose codeword is of length 1? I thought of 2 cases where this ...
30 views

33 views

### What is the time complexity of the below algorithm?

Below I have two algorithms for finding the maximum 2 numbers from an array of numbers of size>=2. n=Size of the array Algorithm 1:- 1. Loop through the array, find the index of max number. (n ...
28 views

### What are expanding opcodes? What are they good for? What would be a simple example?

I really am in need of some thorough explanation here. A little bit simpler and more understandable than in the textbooks or youtube slides lectures. Turned out to be slightly more complicated to ...
29 views

### Does a Turing complete set of invertible combinators exist?

We'll say that a combinator A is invertible if there exists A' s.t. A'(Ax) = A(A'x) = x For example, Sxyz = xz(yz) is clearly invertible in this sense because we ...
17 views

### Computing a shortest $M$-alternating walk (for the Blossom algorithm)

When explaining the Blossom algorithm for maximum (nonbipartite) matchings, Shrijver describes, given a simple graph $G = (V,E)$, a matching $M \subseteq E$, and the set $X \subseteq V$ of nodes ...
28 views

### Is this problem hard? Finding all the subsets of size k from a sequence of n numbers

I want to know the hardness of finding all subsets of size k from a sequence of n numbers. There is an algorithm based on recursion: Print all possible combinations of r elements in a given array of ...
13 views

### What year exactly did Dijkstra distribute EWD682?

The Dijkstra's archive says EWD682 was written or distributed between 1976--1979. I wonder if you can tell the exact year. It might not be easy since the archive itself didn't make it.
11 views

### How could the Cuckoo Search be implemented into Python? (Presumably a solver) [on hold]

I was looking to do this for just a fun project, and maybe mine some GRIN coin.The proof-of-work for GRIN is the cuck(ar)oo29 algorithm, with 29 nodes in each graph. There is also an ASIC chain, for ...
51 views

### What are the axioms of automata theory?

Every theory has axioms and theorems derived from axioms. How many axioms are there for automata theory? What are the axioms of automata theory?
44 views

### Small space hash functions that are weakly but not strongly universal

This is a follow up to this this question about weakly universal hash functions A family of hash functions $H_w$ is said to be weakly universal if for all $x \ne y$ : P_{h \in H_w}(h(x) = h(y)) \...
27 views

### Minimum Spanning Tree with one particular edge minimised(continued)

I have recently encountered a coding problem, specifically, the CCC problem S4. In the problem, it states that you are given a spanning tree, or otherwise a "valid plan of pipes", that connect each ...
42 views

### Mildly context-sensitive grammar

Consider a context-sensitive grammar $G$, such that all the productions of $G$ have the form $A\to \alpha$ or $Ab \to \alpha b$ (in other words, the left context is always empty and the right context ...
18 views

### Converting CFG from GNF to CNF

I am working with grammars that need to be in Greibach Normal Form. I want to check whether a grammar recognises a string. In order to perform CYK the grammar would have to be converted into CNF. Is ...
28 views

### Recursively edit 2-D array using backtracking

I have a 2-D array which contain 3 types of elements: C (Contaminant) R (Rock) W (Water) The rule is that: contaminant can seep through water but not through rocks. Let's say I have the ...
24 views

### Relative efficiency of n tasks in 1 loop vs. 1 task each in n loops?

Say I have 3 simple tasks, to find the min, the max, and the average of an array of numbers. A modular approach would be to write one function for each, thus iterating over the array thrice. However, ...
40 views

### Minimum spanning tree such that one edge can be minimised

During a computer coding exam, I have encountered such a problem. Given a list of vertexes and edges between the vertexes,and a positive number, D, what is the minimum spanning tree between the ...
I try to make an animation of plot in Matlab using vector $X$, vector $Y$ and given time vector $T$. There are several examples related to animation and plot with random time and with 'pause(t)'. It ...


text:
# Introduction

The joineRML package implements methods for analyzing data from multiple longitudinal studies in which the responses from each subject consists of time-sequences of repeated measurements and a possibly censored time-to-event outcome. The modelling framework for the repeated measurements is the multivariate linear mixed effects model. The model for the time-to-event outcome is a Cox proportional hazards model with log-Gaussian frailty. Stochastic dependence is captured by allowing the Gaussian random effects of the linear model to be correlated with the frailty term of the Cox proportional hazards model. For full details of the model, please consult the technical vignette by running

vignette("technical", package = "joineRML")

# Heart valve data

## Data

The simplest way to explain the concepts of the package is through an example. joineRML comes with the data set heart.valve. Details of this data can be found in the help file by running the command

help("heart.valve", package = "joineRML")

This data is in so-called long or unbalanced format:

library("joineRML")
data("heart.valve")
head(heart.valve)
##   num sex      age      time    fuyrs status grad log.grad   lvmi log.lvmi
## 1   1   0 75.06027 0.0109589 4.956164      0   10 2.302585 118.98 4.778955
## 2   1   0 75.06027 3.6794520 4.956164      0   10 2.302585 118.98 4.778955
## 3   1   0 75.06027 4.6958900 4.956164      0   10 2.302585 137.63 4.924569
## 4   2   0 45.79452 6.3643840 9.663014      0   14 2.639057 114.93 4.744323
## 5   2   0 45.79452 7.3041100 9.663014      0    9 2.197225 109.80 4.698661
## 6   2   0 45.79452 8.3013700 9.663014      0   12 2.484907 157.40 5.058790
##   ef  bsa lvh prenyha redo size con.cabg creat dm acei lv emergenc hc
## 1 93 1.77   1       3    0   27        1   103  0    1  1        0  0
## 2 93 1.77   1       3    0   27        1   103  0    1  1        0  0
## 3 93 1.77   1       3    0   27        1   103  0    1  1        0  0
## 4 68 1.92   1       1    1   22        0    76  0    0  2        0  0
## 5 70 1.92   1       1    1   22        0    76  0    0  2        0  0
## 6 56 1.92   1       1    1   22        0    76  0    0  2        0  0
##   sten.reg.mix              hs
## 1            1 Stentless valve
## 2            1 Stentless valve
## 3            1 Stentless valve
## 4            1       Homograft
## 5            1       Homograft
## 6            1       Homograft

The data refer to 256 patients and are stored in the unbalanced format, which is convenient here because measurement times were unique to each subject. The data are stored as a single R object, heart.valve, which is a data frame of dimension 988 by 25. The average number of repeated measurements per subject is therefore 988/256 = 3.86. As with any unbalanced data set, values of time-constant variables are repeated over all rows that refer to the same subject. The dimensionality of the data set can be confirmed by a call to the dim() function, whilst the names of the 25 variables can be listed by a call to the names() function:

dim(heart.valve)
## [1] 988  25
names(heart.valve)
##  [1] "num"          "sex"          "age"          "time"
##  [9] "lvmi"         "log.lvmi"     "ef"           "bsa"
## [13] "lvh"          "prenyha"      "redo"         "size"
## [17] "con.cabg"     "creat"        "dm"           "acei"
## [21] "lv"           "emergenc"     "hc"           "sten.reg.mix"
## [25] "hs"

We will only analyse a subset of this data, namely records with case-complete data for heart valve gradient (grad) and left ventricular mass index (lvmi):

hvd <- heart.valve[!is.na(heart.valve$grad) & !is.na(heart.valve$lvmi), ]

Strictly speaking, this is not necessary because joineRML can handle the situation of different measurement schedules within subjects That is, a subject does not need to have all multiple longitudinal outcomes recorded at each visit. It is conceivable that some biomarkers will be measured more or less frequently than others. For example, invasive measurements may only be recorded annually, whereas a simple biomarker measurement might be recorded more frequently. joineRML can handle this situation by specifying each longitudinal outcome its own data frame.

## Model fitting

The main function in the joineRML package is the mjoint() function. Its main (required) arguments are:

• formLongFixed: a list (of length equal to the number of longitudinal outcome types considered) of two-sided formulae specifying the response on the left-hand side and the mean linear predictor terms for the fixed effects in the linear mixed models on the right-hand side.

• formLongRandom: a list (of same length as formLongFixed) of one-sided formulae specifying the model for random effects in the linear mixed models.

• formSurv: a formula specifying the proportional hazards regression model for the time-to-event outcome in the same structure as for survival::coxph.

• data: a list (of same length as formLongFixed) of data.frames; one for each longitudinal outcome. It is assumed that the event time data is in the first data.frame (i.e. data[[1]]), unless the argument survData (which defaults to NULL) is specified. If $$K>1$$ and the data are balanced within patients (i.e. multiple markers measured at common measurement times), then one can specify data as a data frame rather than as a list.

• timeVar: the column name indicating the time variable in the linear mixed effects model. If $$K>1$$ and the data frames have different column names for time, then timeVar can alternatively be specified as a vector of strings of length $$K$$.

We can fit a bivariate joint model to the log-transformed valve gradient and LVMI indices in the hvd subset using

set.seed(12345)
fit <- mjoint(
formLongFixed = list("grad" = log.grad ~ time + sex + hs,
"lvmi" = log.lvmi ~ time + sex),
formLongRandom = list("grad" = ~ 1 | num,
"lvmi" = ~ time | num),
formSurv = Surv(fuyrs, status) ~ age,
data = list(hvd, hvd),
inits = list("gamma" = c(0.11, 1.51, 0.80)),
timeVar = "time")
## Running multivariate LMM EM algorithm to establish initial parameters...
## Finished multivariate LMM EM algorithm...
## EM algorithm has converged!
## Calculating post model fit statistics...

Details on the model estimation algorithm are provided in the technical details vignette. We note here that this is not necessarily the most appropriate model for the data, and is included only for the purposes of demonstration. There are a number of other useful arguments in the mjoint function; for example, inits for specifying (partial) initial values, control for controlling the optimization algorithm, and verbose for monitoring the convergence output in real-time. A full list of all arguments with explanation are given in the help documentation, accessed by running help("mjoint").

## Post-fit analysis

Once we have a fitted mjoint object, we can begin to extract relevant information from it. Most summary statistics are available from the summary function:

summary(fit)
##
## Call:
## mjoint(formLongFixed = list(grad = log.grad ~ time + sex + hs,
##     lvmi = log.lvmi ~ time + sex), formLongRandom = list(grad = ~1 |
##     num, lvmi = ~time | num), formSurv = Surv(fuyrs, status) ~
##     age, data = list(hvd, hvd), timeVar = "time", inits = list(gamma = c(0.11,
##     1.51, 0.8)))
##
## Data Descriptives:
##
## Event Process
##     Number of subjects: 221
##     Number of events: 47 (21.3%)
##
## Longitudinal Process
##     Number of longitudinal outcomes: K = 2
##     Number of observations:
##       Outcome 1 (grad): n = 629
##       Outcome 2 (lvmi): n = 629
##
## Joint Model Summary:
##
## Longitudinal Process: Multivariate linear mixed-effects model
##      log.grad ~ time + sex + hs, random = ~1 | num
##      log.lvmi ~ time + sex, random = ~time | num
## Event Process: Cox proportional hazards model
##      Surv(fuyrs, status) ~ age
## Model fit statistics:
##    log.Lik      AIC      BIC
##  -991.1137 2018.227 2079.394
##
## Variance Components:
##
## Random effects variance covariance matrix
##               (Intercept)_1 (Intercept)_2     time_2
## (Intercept)_1     0.1058000      0.019288  0.0036944
## (Intercept)_2     0.0192880      0.118970 -0.0062780
## time_2            0.0036944     -0.006278  0.0024684
##   Standard Deviations: 0.32527 0.34492 0.049683
##
## Residual standard errors(s):
##  sigma2_1  sigma2_2
## 0.5961137 0.1927721
##
## Coefficient Estimates:
##
## Longitudinal sub-model:
##                       Value Std.Err  z-value p-value
## (Intercept)_1        2.5082  0.0642  39.0944 <0.0001
## time_1              -0.0043  0.0133  -0.3256  0.7447
## sex_1                0.1439  0.0769   1.8707  0.0614
## hsStentless valve_1  0.1881  0.0743   2.5321  0.0113
## (Intercept)_2        5.0897  0.0339 150.2164 <0.0001
## time_2              -0.0098  0.0068  -1.4363  0.1509
## sex_2               -0.1993  0.0549  -3.6271  0.0003
##
## Time-to-event sub-model:
##          Value Std.Err z-value p-value
## age     0.1087  0.0160  6.7832 <0.0001
## gamma_1 1.5097  0.9038  1.6704  0.0948
## gamma_2 0.7968  0.6469  1.2316  0.2181
##
## Algorithm Summary:
##     Total computational time: 1.2 mins
##     EM algorithm computational time: NA mins
##     Convergence status: converged
##     Convergence criterion: sas
##     Final Monte Carlo sample size: 5549
##     Standard errors calculated using method: approx

One can also extract the coefficients, fixed effects, and random effects using standard generic functions:

coef(fit)
## $D ## (Intercept)_1 (Intercept)_2 time_2 ## (Intercept)_1 0.105802296 0.019288342 0.003694426 ## (Intercept)_2 0.019288342 0.118969721 -0.006277957 ## time_2 0.003694426 -0.006277957 0.002468353 ## ##$beta
##       (Intercept)_1              time_1               sex_1
##         2.508158052        -0.004341931         0.143942569
## hsStentless valve_1       (Intercept)_2              time_2
##         0.188133752         5.089659402        -0.009781482
##               sex_2
##        -0.199276836
##
## $sigma2 ## sigma2_1 sigma2_2 ## 0.35535159 0.03716109 ## ##$haz
##  [1] 0.001867911 0.001875488 0.002019183 0.002227192 0.002262268
##  [6] 0.002339430 0.002396734 0.002400211 0.002438572 0.002454757
## [11] 0.002468868 0.002677928 0.002733153 0.002791940 0.002812594
## [16] 0.002847601 0.002897962 0.003033319 0.003165194 0.003371493
## [21] 0.003654905 0.007654983 0.004255871 0.004474953 0.004580072
## [26] 0.004772205 0.005185041 0.005314130 0.006236632 0.006772426
## [31] 0.006941574 0.007154566 0.007266036 0.007859618 0.008533176
## [36] 0.008897458 0.009259170 0.010058941 0.011949178 0.012322053
## [41] 0.013659672 0.016515838 0.017034043 0.046464128 0.048604005
## [46] 0.247706507
##
## $gamma ## age gamma_1 gamma_2 ## 0.1087459 1.5096743 0.7967613 fixef(fit, process = "Longitudinal") ## (Intercept)_1 time_1 sex_1 ## 2.508158052 -0.004341931 0.143942569 ## hsStentless valve_1 (Intercept)_2 time_2 ## 0.188133752 5.089659402 -0.009781482 ## sex_2 ## -0.199276836 fixef(fit, process = "Event") ## age gamma_1 gamma_2 ## 0.1087459 1.5096743 0.7967613 head(ranef(fit)) ## (Intercept)_1 (Intercept)_2 time_2 ## 1 -0.20321013 -0.244778995 0.010441871 ## 2 -0.04384301 -0.176901441 0.001807459 ## 3 -0.01740527 0.006699592 0.010510071 ## 4 -0.42728153 -0.596236132 0.012313738 ## 5 -0.05173721 0.077815662 0.021615134 ## 6 0.23306568 0.227851417 0.006021618 Although a model fit may indicate convergence, it is generally a good idea to examine the convergence plots. These can be viewed using the plot function for each group of model parameters. plot(fit, params = "gamma") plot(fit, params = "beta") ## Bootstrap standard errors Once an mjoint model has converged, and assuming the pfs argument is TRUE (default), then approximated standard errors are calculated based on the empirical information matrix of the profile likelihood at the maximizer. Theoretically, these standard errors will be underestimated (see the technical vignette). In principle, residual Monte Carlo error will oppose this through an increase in uncertainty. fit.se <- bootSE(fit, nboot = 100) Bootstrapping is a computationally intensive method, possibly taking many hours to fit. For this reason, one can relax the control parameter constraints on the optimization algorithm for each bootstrap model; however, this will be at the possible expense of inflated standard errors due to Monte Carlo error. We can call the bootSE object to interrogate it fit.se or alternatively re-run the summary command, passing the additional argument of bootSE = fit.se summary(fit, bootSE = fit.se) # Univariate joint models: joineRML versus joineR There are a growing number of software options for fitting joint models of a single longitudinal outcome and a single time-to-event outcome; what we call here univariate joint models. joineR (version 1.1.0) is one package available in R for fitting such models, however joineRML can fit these models too, since the univariate model is simply a special case of the multivariate model. It is useful to contrast these two packages. There are theoretical and practical implementation differences between the packages beyond just univariate versus multivariate capability: • joineR uses Gauss-Hermite quadrature (with 3 nodes) for numerical integration, whereas joineRML uses Monte Carlo integration with an automated selection of sample size. • joineR only allows for random-intercept models, random-intercept and random-slope models, or a quadratic model. joineRML, on the other hand, allows for any random effects structure. • joineR only allows for specification of convergence based on an absolute difference criterion. • joineR does not calculate approximate standard errors, and instead requires a bootstrap approach be used after the model fit. • The current version of joineR requires a data pre-processing step in order to generate a joint.data object, whereas joineRML can work straight from the data frame. To fit a univariate model in joineR we run the following code for the hvd data library(joineR, quietly = TRUE) hvd.surv <- UniqueVariables(hvd, var.col = c("fuyrs", "status"), id.col = "num") hvd.cov <- UniqueVariables(hvd, "age", id.col = "num") hvd.long <- hvd[, c("num", "time", "log.lvmi")] hvd.jd <- jointdata(longitudinal = hvd.long, baseline = hvd.cov, survival = hvd.surv, id.col = "num", time.col = "time") fit.joiner <- joint(data = hvd.jd, long.formula = log.lvmi ~ time + age, surv.formula = Surv(fuyrs, status) ~ age, model = "intslope") summary(fit.joiner) ## ## Call: ## joint(data = hvd.jd, long.formula = log.lvmi ~ time + age, surv.formula = Surv(fuyrs, ## status) ~ age, model = "intslope") ## ## Random effects joint model ## Data: hvd.jd ## Log-likelihood: -373.2656 ## ## Longitudinal sub-model fixed effects: log.lvmi ~ time + age ## (Intercept) 4.9979864721 ## time -0.0096970070 ## age 0.0004407409 ## ## Survival sub-model fixed effects: Surv(fuyrs, status) ~ age ## age 0.1058821 ## ## Latent association: ## gamma_0 1.072406 ## ## Variance components: ## U_0 U_1 Residual ## 0.128470783 0.002561009 0.037055051 ## ## Convergence at iteration: 18 ## ## Number of observations: 629 ## Number of groups: 221 To fit a univariate model in joineRML we run the following code for the hvd data set.seed(123) fit.joinerml <- mjoint(formLongFixed = log.lvmi ~ time + age, formLongRandom = ~ time | num, formSurv = Surv(fuyrs, status) ~ age, data = hvd, timeVar = "time") ## EM algorithm has converged! ## Calculating post model fit statistics... summary(fit.joinerml) ## ## Call: ## mjoint(formLongFixed = log.lvmi ~ time + age, formLongRandom = ~time | ## num, formSurv = Surv(fuyrs, status) ~ age, data = hvd, timeVar = "time") ## ## Data Descriptives: ## ## Event Process ## Number of subjects: 221 ## Number of events: 47 (21.3%) ## ## Longitudinal Process ## Number of longitudinal outcomes: K = 1 ## Number of observations: ## Outcome 1: n = 629 ## ## Joint Model Summary: ## ## Longitudinal Process: Univariate linear mixed-effects model ## log.lvmi ~ time + age, random = ~time | num ## Event Process: Cox proportional hazards model ## Surv(fuyrs, status) ~ age ## Model fit statistics: ## log.Lik AIC BIC ## -373.2707 764.5414 795.1249 ## ## Variance Components: ## ## Random effects variance covariance matrix ## (Intercept)_1 time_1 ## (Intercept)_1 0.1277800 -0.0065414 ## time_1 -0.0065414 0.0024152 ## Standard Deviations: 0.35746 0.049145 ## ## Residual standard errors: ## sigma2_1 ## 0.193006 ## ## Coefficient Estimates: ## ## Longitudinal sub-model: ## Value Std.Err z-value p-value ## (Intercept)_1 4.9983 0.1401 35.6856 <0.0001 ## time_1 -0.0093 0.0067 -1.4049 0.1600 ## age_1 0.0004 0.0021 0.2069 0.8361 ## ## Time-to-event sub-model: ## Value Std.Err z-value p-value ## age 0.1060 0.0149 7.0969 <0.0001 ## gamma_1 1.0846 0.5413 2.0036 0.0451 ## ## Algorithm Summary: ## EM algorithm computational time: 10.1 secs ## Convergence status: converged ## Convergence criterion: sas ## Final Monte Carlo sample size: 418 ## Standard errors calculated using method: approx In addition to just comparing model parameter estimates, we can also extract the predicted (or posterior) random effects from each model and plot them. id <- as.numeric(row.names(fit.joiner$coefficients$random)) id.ord <- order(id) # joineR rearranges patient ordering during EM fit par(mfrow = c(1, 2)) plot(fit.joiner$coefficients$random[id.ord, 1], ranef(fit.joinerml)[, 1], main = "Predicted random intercepts", xlab = "joineR", ylab = "joineRML") grid() abline(a = 0, b = 1, col = 2, lty = "dashed") plot(fit.joiner$coefficients\$random[id.ord, 2], ranef(fit.joinerml)[, 2],
main = "Predicted random slopes",
xlab = "joineR", ylab = "joineRML")
grid()
abline(a = 0, b = 1, col = 2, lty = "dashed")

format: plain


text:
# Welcome to Code Golf and Coding Challenges Stack Exchange!

## What is this site?

This is a place to host recreational coding challenges, such as code golf. We are unlike most sites in the Stack Exchange network. We are not a question-answer site, nor are we a forum, instead we use the Stack Exchange network as a host for our coding challenges and solutions. Please note that general programming questions are not on-topic here.

This site is split into 3 parts: Main, where people post challenges and solutions; Meta, a site for discussing the main site; and Chat, where users can discuss a large range of topics (not all about the site) in a much more informal manner.

This page is a new users' guide to getting started on the site. Because of our differences to the other Stack Exchange sites, it can be difficult to start here without some knowledge of our long established rules and traditions. Below this question are 3 answers designed to address and help you with specific parts of our site: Asking, Answering and Everything else

## What do I need to know in order to understand these answers?

The answers assume that you have very little knowledge of the Stack Exchange model. However, before reading through them, it's recommended to familiarise yourself with the following terms:

• Upvote: A vote indicating you agree with or like the post, or that you think it's useful. See When should I vote? for more information
• Downvote: A vote indicating you disagree with or dislike the post, or that you don't think it's useful. It's recommend that you leave a comment explaining why you downvoted, to give the post author a chance to correct their post if possible
• Reputation: A score assigned to each user reflecting how useful their contributions to the site are. You gain reputation by contributing in a positive manner, and you lose it by posting low quality, off-topic or spam content.

## I've read through the answers and I still have a question!

The answers below are not designed to be comprehensive - instead, they are supposed to cover the base information we believe new users will benefit the most from. If you still have a question after reading them, check out our FAQ, ask users in chat or post a question on Meta

Additionally, these posts are Community Wiki, which allows anyone with 10 reputation or more to edit them. If you think something is missing that really should be included, don't hesitate to edit it in.

Welcome to CGCC! We hope you enjoy your time on the site!

Asking good, high quality challenges is a key aspect of the site. Some users almost exclusively post challenges, and some prefer instead to only answer. However, asking is very different on this site than most forums or Stack Exchange sites.

## How do I post a challenge?

It's very easy to post a challenge. Simply click the Ask Question button, choose a title, write a specification and choose up to 5 relevant tags. However, writing a high quality challenge takes practice, and a lot of it. We require challenges to meet various different criteria, and hitting all of them at once, especially if you are unpractised, can be difficult.

We highly recommend using the Sandbox before posting a challenge on main. We also suggest answering before asking, as this will allow you to get a better understanding of what a challenge needs to look like, and how well specified one should be.

Furthermore, we have a number of posts designed to help challenge authors:

## How do I format my challenge?

The Stack Exchange network uses a form of Markdown. This includes support for headers, links, images, bold text, italic text, underlined text, lists and more. Additionally, we support a form of $$\\LaTeX\$$ called Mathjax to properly show mathematical equations. For inline Mathjax, use $ delimiters (for example: $3x^2+2x+1\$ is $$\3x^2+2x+1\$$). For blocks of Mathjax, use $\$:

$$\begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{matrix}$$

is shown as

$$\begin{matrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{matrix}$$

Check out the MathJax basic tutorial and quick reference for more help.

## What criteria do challenges need to meet?

Challenges must:

• Have an objective scoring criteria, such as code golf or fastest code
• Be clearly specified. As is the case with all questions on the Stack Exchange network, your challenge must be in English and clearly written. In order to make sure your challenge is clear, we recommend using the Sandbox
• Be unique. Unlike a large number of sites on the internet, we strictly forbid reposts and copies of other people's work. However, we currently have well over 10000 questions, and it is unfeasible to expect you to check every single one. What we do expect is that you make a brief and honest search for anything similar, and that you don't explicitly copy an existing challenge. Furthermore, posting in the Sandbox is a good way to avoid posting duplicate challenges to main.
• Be on topic. We do not allow general programming help questions. Those belong on Stack Overflow, not here. Before posting your question, make sure it is on topic. If you aren't sure, feel free to ask in chat or post a draft to the Sandbox asking if it is.

## What are the possible scoring criteria?

All challenges must have an objective scoring criteria. A full list can be found here, but the most popular are:

• : An answer's score is the length of the code in bytes
• : The winner is the fastest code. These challenges typically involve timing submissions on the author's computer, so should include your computer specifications
• : Scores are calculated in any other objective manner than existing criteria

By the simplistic nature of its scoring criteria, is the easiest challenge type to write. Furthermore, non-code golf challenges can be very easy to underspecify or can have a scoring criteria which does not encourage competition. We suggest that, before writing a challenge with a specific winning criteria, you answer an existing challenge with the same criteria, in order to get a hang of the nuances of the scoring.

## What is this Sandbox you keep mentioning?

The Sandbox for Proposed Challenges is a place where you can post your challenge drafts in order to get feedback on them before posting to main. Going through the Sandbox first allows you to fix unclear details, avoid downvotes and close votes, and prevent answerers from exploiting loopholes in your challenge, thus ruining the fun for you. While a draft is here, people will offer advice and feedback on how to improve it. See How does the Sandbox work? How do I use it? and Sandbox instructions for new users for more information

We also encourage you to do the same: if you have a few minutes of free time to spend, consider looking at some recently active drafts and leave some feedback. Furthermore, we have a userscript designed to improve the feedback process. While a draft is in the Sandbox, voting customs change slightly:

• Upvoting signifies that you believe the challenge is ready and will be well received on main
• Downvoting suggests you believe that, even if fully clarified, the challenge is unlikely to do well on main

## How long should I leave a draft in the Sandbox?

A week is the most recommended time. For more complex challenges, longer is better and for more basic challenges, you can get away with a few days.

There is no hard or fast limit though. We do have a number of recommended points to check off before posting, however:

• It's generally recommended to wait a minimum of 72 hours in order to allow enough people to see your draft.
• If a draft has a score of +3 or more, it's likely to be well received
• If you've gone 2 days without any further feedback from commenters, it's likely to be clear enough to be posted. This assumes you've been regularly asking for feedback.
• Don't assume you've addressed all Sandbox feedback however. Posting a draft into the Sandbox is not a guarantee of quality, and it requires participation from other users to work as intended. Properly read through your draft and repeatedly ask for feedback. Don't worry about annoying people; so long as you don't ask exceedingly often, people will be more than happy to leave even a small amount of feedback.

## How do I get feedback on my Sandbox posts?

The Nineteenth Byte has a chat feed that posts recently Sandboxed drafts into chat. When you first post your draft, you don't need to post a link into chat, as the feed will do this for you.

## I've posted my challenge. Now what?

Now you wait for the upvotes and answers. Some users may request additional clarifications in the comments. So long as you answer these promptly and don't contradict the main post, this won't be an issue. Be sure to edit in any clarifications or rule changes you make into the main post after leaving a comment. Please do not significantly change your challenge after posting it as this can invalidate people's answers.

We also recommend against accepting an answer, in order to fairly and properly promote competition within languages, rather than between languages.

## I posted my challenge in the Sandbox but it got closed on Main!

Sometimes, however, people will find things that were missed in the Sandbox that make the challenge unclear. The Sandbox is not a perfect system. If this happens, your challenge may be closed as "Needs details or clarity". Don't worry. Closing challenges is designed to be a temporary measure, and every closed challenge can be reopened in the same manner.

In order to get your challenge reopened, take a look through the comments underneath it. People will have commented exactly what they found unclear with the challenge, and addressing these points is the quickest way to reopen it. Additionally, if you are able to, asking what could be improved in chat allows people to have more of a discussion than in comments. You are able to ask the specific users who voted to close your challenge by "pinging" them either in comments or chat (@username), but keep in mind that they are under no obligation to answer you.

Editing a closed challenge automatically sends it to the Reopen votes review queue where users will review your updated challenge and decide whether or not it is clear enough to be reopened.

For more questions about asking, check out the "How to Ask" help pages or browse the tag on Meta.

• Not sure I wanted to edit this into the question, so putting it here in comments: Don't necessarily be put off if your sandbox challenge gets lots of downvotes. In almost all cases, downvotes will come with criticism and feedback. This can be very useful and help to forge a worthy challenge anyway. And while that may not reverse the sandbox score, it might help you develop a nice challenge that you feel confident about and gets loads of good responses (and hopefully votes). My own highest scoring challenge is based off of my second lowest scoring sandbox post (-1). That feedback really helped. – ouflak Mar 16 at 15:37

Unlike most Stack Exchange sites, answers here are typically easier to write than questions. However, there are a few things that every answer needs to include, and a couple of criteria they should meet.

## What should my answer look like?

We have a standard format for answers, which you can get hold of in 2 main ways.

If your language is on Try it online!, you can write up your solution in the Code section on Try it online! (commonly referred to as TIO), click the "Link" button at the top of the page and Copy-Paste the test in the "Code Golf submission (Stack Exchange)" field.

Alternatively, the standard formats are, in Markdown:

For challenges:

# [<Language Name>][1], <length> bytes

[Try it here!][2]

<explanation>

[2]: <link to an online testing environment>

For other challenges:

# [<Language Name>][1], <score>

[Try it here!][2]

<explanation>

[2]: <link to an online testing environment>

## What should and shouldn't be in my answer?

• The language name
• Your score, as defined by the challenge
• The code you are submitting

• Promotions or links unrelated to the challenge
• Spam
• Language such as "Hi", "Thanks for the challenge" or other chatty language

• Make a serious effort at winning. This doesn't mean that you have to have the shortest code in a challenge to participate, but it does mean you shouldn't post code with long variable names, unnecessary whitespace and more.
• Complete the task in the question. If the question asks you to print Hello, World! and your code does anything other than print Hello, World!, it is not a valid answer. Make sure that you handle all the test cases included in the question.
• Not break any of the standard loopholes.

## What are all these crazy short answers?

We allow any languages to be used on the site, so long as you can provide a working interpreter. A lot of people decide to create their own languages specifically designed for code golf, leading to the rise of languages such as Golfscript, CJam, Jelly and others.

Don't worry about these. If you prefer to golf in a language you're more familiar with, please, use that language, and don't care about how long it is. Languages such as Java are generally going to be more competitive with similar languages (e.g. C#) rather than with golfing languages, and so we prefer to consider challenges as competitions within languages. So 05AB1E answers try to compete with other 05AB1E answers and other golfing languages, while Java answers try to compete with other Java answers and with languages comparable to it.

Some languages use characters outside of the standard ASCII range. Often, these use custom code pages to encode their answers instead of the standard Unicode table. If you have any doubts or concerns, don't hesitate to leave a comment or check out our How to count bytes FAQ.

## Ok, I want to answer a challenge. How do I do that?

The easiest way to get started is to just start! Head over to the challenges page and choose one you like the look of. Fire up your favourite code editor/IDE/whatever you use to code, and start working on a solution to the challenge. Once you've got a working program, post it as an answer. Some things to help you:

• If the challenge includes a bunch of test cases, setting up a testing environment where you can quickly check that your code still works for each input after any changes is a smart way to keep your answer valid
• The New users' guides to golfing rules in specific languages is likely to contain specific examples, rules and details for competing in challenges for your favourite language.
• pages will likely have ways you can golf down your answer. Almost every language under the sun has a "Tips for golfing in language" page, so searching for it (add your language name after the "in" in the search bar) will most likely help you save some bytes.
• Avoid the standard loopholes. They were funny in 2011, but the site now strives towards good quality answers.
• The standard Input and Output methods list various different ways you can take input and output
• Note that inputting via a variable ("The input is in variable s") is not a permissible method of input.
• Programs must be full programs or functions, not snippets.
• Don't worry about not being the shortest answer there. Other users are more than willing to suggest golfing opportunities and ways you can improve your solution.

For more questions about answering, check out the "How to Answer" help pages or browse the tag on Meta.

# Everything Else

Despite being primarily for challenges and solutions, there is still a lot more to the site. This post addresses some of the more common questions about aspects of the site aside from asking and answering.

## Who moderates this site?

We all do. Unlike the vast majority of sites on the Internet, Stack Exchange sites are moderated by their communities, barring a few exceptions. There are three "categories of users":

• Stack Exchange employees. These are the users who work at the company Stack Exchange. You'll very rarely see them around the site, and if you do, they'll likely be on Meta.
• Diamond moderators. These are democratically elected users who handle the rare circumstances where standard users cannot moderate. Typically, this involves flags or stepping in during disagreements. You can see if a user is a diamond moderator as they have a ♦ next to their name at all times. Despite being moderators, they are still members of the community and should be treated as you would treat any other user.
• Everyone else. These are the 99.999% of users, and the vast majority of the users you'll interact with on the site.

So how does the community moderate the site? Through privileges, which are directly tied to your reputation score. There are a lot of different privileges you can get, ranging from needing 1 reputation to 25000, but the ones involving moderation are:

## What is the Meta site?

Meta is a separate but related site where users can discuss the site itself. Topics include our Language of the Month series, policy decisions (either on specific languages or in general), our Sandbox for Proposed Challenges and much more.

Keep in mind that Meta is not a place to post your closed challenges, and doing so will lead to the Meta post being closed as well.

## What is commenting, and what is it for?

You can also notify one additional user in a comment by including "@username" in the comment. You can notify anyone who has commented on or edited the post this way. See How do comment @replies work? for more information.

## What should I do if I see a mistake in someone's post?

Edit it! Underneath every post is a link saying Edit. Click this link and you'll be able to edit the post. However, until you reach 2000 reputation, your edits will be reviewed by higher reputation users before they're applied. Vandalism is not ok on any post, even your own, and can lead to a temporary edit ban if done repeatedly.

Do not use edits to golf solutions. Edits that try to improve an answer's score will be rejected. You should leave these improvements as comments instead.

See When it is and is not acceptable to edit someone else's post for more guidelines on editing.

## What are the gold, silver and bronze icons next to people's usernames?

These are badges. They are awarded when users perform certain actions. Aside from being nice, shiny icons next to your name, they have no effect beyond telling other users that you did a specific thing.

## How do I use chat?

Chat is the place users can go to talk about more or less anything they like. It is made up of rooms, each with a specific topic. You need 20 reputation across the Stack Exchange network to chat in public rooms, 100 reputation to create your own public rooms and 1000 reputation to create gallery rooms.

The Nineteenth Byte is our site's main chat room. As said in the room description, it is for

General discussion for codegolf.stackexchange.com

This is deliberately vague; "General discussion" means exactly that. However, we do have a Chatiquette that we ask you follow while chatting in the room. Please read through it at least once before chatting in the room - don't worry, it's short.

## CGCC? TIO? TNB? VTC? What are all these acronyms?

What are our specific abbreviations and terms?

A full glossary of terms can be found in that post, along with more general ones here. The most commonly used are:

• CGCC: Code Golf and Coding Challenges, the name of the site
• TIO: Try it online!
• TNB: The Nineteenth Byte
• VTC/VTRO/VTD: Vote to Close, Reopen and Delete, respectively. Various different moderation votes available to users.
• PPCG: Programming Puzzles and Code Golf, the former name of the site, still used by the older users.

For more questions about various aspects of the site, browse through the recently active Meta questions, or ask in chat.


text:
# Definition:Module

## Definition

Let $\left({R, +_R, \times_R}\right)$ be a ring.

Let $\left({G, +_G}\right)$ be an abelian group.

A module over $R$ is an $R$-algebraic structure with one operation $\left({G, +_G, \circ}\right)_R$ which is both a left module and a right module:

### Left Module

Let $\left({R, +_R, \times_R}\right)$ be a ring.

Let $\left({G, +_G}\right)$ be an abelian group.

A left module over $R$ is an $R$-algebraic structure $\left({G, +_G, \circ}\right)_R$ with one operation $\circ$, the (left) ring action, which satisfies the left module axioms:

 $(1)$ $:$ $\displaystyle \forall \lambda \in R: \forall x, y \in G:$ $\displaystyle \lambda \circ \left({x +_G y}\right) = \left({\lambda \circ x}\right) +_G \left({\lambda \circ y}\right)$ $(2)$ $:$ $\displaystyle \forall \lambda, \mu \in R: \forall x \in G:$ $\displaystyle \left({\lambda +_R \mu}\right) \circ x = \left({\lambda \circ x}\right) +_G \left({\mu \circ x}\right)$ $(3)$ $:$ $\displaystyle \forall \lambda, \mu \in R: \forall x \in G:$ $\displaystyle \left({\lambda \times_R \mu}\right) \circ x = \lambda \circ \left({\mu \circ x}\right)$

### Right Module

Let $\left({R, +_R, \times_R}\right)$ be a ring.

Let $\left({G, +_G}\right)$ be an abelian group.

A right module over $R$ is an $R$-algebraic structure $\left({G, +_G, \circ}\right)_R$ with one operation $\circ$, the (right) ring action, which satisfies the right module axioms:

 $(1)$ $:$ $\displaystyle \forall \lambda \in R: \forall x, y \in G:$ $\displaystyle \left({x +_G y}\right) \circ \lambda = \left({x \circ \lambda}\right) +_G \left({y \circ \lambda}\right)$ $(2)$ $:$ $\displaystyle \forall \lambda, \mu \in R: \forall x \in G:$ $\displaystyle x \circ \left({\lambda +_R \mu}\right) = \left({x \circ \lambda}\right) +_G \left({x\circ \mu}\right)$ $(3)$ $:$ $\displaystyle \forall \lambda, \mu \in R: \forall x \in G:$ $\displaystyle x \circ \left({\lambda \times_R \mu}\right) = \left({x \circ \lambda}\right) \circ \mu$

Note that a module is not an algebraic structure unless $R$ and $G$ are the same set.

### Scalar

The elements of the scalar ring $\left({R, +_R, \times_R}\right)$ are called scalars.

### Vector

The elements of $\left({G, +_G}\right)$ are called vectors.

### Zero Vector

The identity of $\left({G, +_G}\right)$ is usually denoted $\mathbf 0$, or some variant of this, and called the zero vector.

Note that on occasion it is advantageous to denote the zero vector differently, for example by $e$, or $0_V$ or $0_G$, in order to highlight the fact that the zero vector is not the same object as the zero scalar.

## Also defined as

Sources who only deal with rings with unity often define a module as what on $\mathsf{Pr} \infty \mathsf{fWiki}$ is called a unitary module.

Sometimes no distinction is made between the module and the associated ring representation.

## Also known as

A module over $R$ can also be referred to as an $R$-module.

## Also see

• Results about modules can be found here.


text:
Summer is Coming! Join the Game of Timers Competition to Win Epic Prizes. Registration is Open. Game starts Mon July 1st.

 It is currently 18 Jul 2019, 20:52

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# The function f is defined for all positive integers n > 4 as

Author Message
TAGS:

### Hide Tags

Manager
Status: Final Lap
Joined: 25 Oct 2012
Posts: 230
Concentration: General Management, Entrepreneurship
GPA: 3.54
WE: Project Management (Retail Banking)
The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

15 Jan 2014, 12:00
8
29
00:00

Difficulty:

95% (hard)

Question Stats:

41% (02:51) correct 59% (02:55) wrong based on 343 sessions

### HideShow timer Statistics

The function f is defined for all positive integers n > 4 as f(n) = 3n – 9 if n is odd and f(n) = 2n – 7 if n is even. What is the value of the positive integer a?

(1) f(f(a)) = a

(2) f(f(f(a))) is odd.

_________________
KUDOS is the good manner to help the entire community.

Magoosh GMAT Instructor
Joined: 28 Dec 2011
Posts: 4487
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

15 Jan 2014, 18:09
28
11
Rock750 wrote:
The function f is defined for all positive integers n > 4 as f(n) = 3n – 9 if n is odd and f(n) = 2n – 7 if n is even. What is the value of the positive integer a?

(1) f(f(a)) = a

(2) f(f(f(a))) is odd.

I'm happy to help. As usual, this is a spectacularly clever problem from those folks at MGMAT.

Here's a blog you may find helpful on function notation:
http://magoosh.com/gmat/2012/function-n ... -the-gmat/

Notice that for this particular function, when f(n) has an even input, it yields an odd output, and vice versa: when it has an odd input, it yield an even output.

Statement #1:
Well, if a is even, then f(a) = 2a - 7, which will be odd, and f(f(a)) = 3(2a - 7) - 9 = 6a - 30.
Then, if f(f(a)) = a, we have
6a - 30 = a
5a = 30
a = 6
That's one possible value.
If a is odd, then f(a) = 3a - 9, which will be even, and f(f(a)) = 2(3a - 9) - 7 = 6a - 25
Then, if f(f(a)) = a, we have
6a - 25 = a
5a = 25
a = 5
That's also one possible value.
This statement yields two possible values, so no definitive answer to the prompt. This statement, alone and by itself, is insufficient.

Statement #2:
If f(f(f(a))) is odd,
then f(f(a)) is even,
and f(a) is odd,
and a is even.
This tells us that a is even, but a could be any even number.
This statement yields no definitive answer to the prompt. This statement, alone and by itself, is insufficient.

Combined
We have two values from statement #1. From statement #2, we know a must be even. This means that a = 6. Now, we can give a definitive answer to the prompt question. Combined, the statements are sufficient.

Does all this make sense?
Mike
_________________
Mike McGarry
Magoosh Test Prep

Education is not the filling of a pail, but the lighting of a fire. — William Butler Yeats (1865 – 1939)
##### General Discussion
Manager
Joined: 25 Oct 2013
Posts: 143
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

01 Feb 2014, 06:58
1
2
Stmt1: f(f(a))=a

If a is odd f(a) = 3a-9 this is even.
f(f(a))=2(3a-9)-7 = a (given)
solving a = 5.

If a is even f(a) is odd.
solving f(f(a))=a
gives us a=6.

Since 2 values of a are possible, stmt 1 is INSUFF.

Stmt2: f(f(f(a))) is odd
then f(f(a)) is even
f(a) is odd
a is even. Clearly INSUFF

Stmt1+stmt2: a=5 or 6 and a is even. a can only be 6. Hence C.
_________________
Click on Kudos if you liked the post!

Practice makes Perfect.
Manager
Joined: 15 Aug 2013
Posts: 239
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

11 May 2014, 14:59
mikemcgarry wrote:
Rock750 wrote:
The function f is defined for all positive integers n > 4 as f(n) = 3n – 9 if n is odd and f(n) = 2n – 7 if n is even. What is the value of the positive integer a?

(1) f(f(a)) = a

(2) f(f(f(a))) is odd.

I'm happy to help. As usual, this is a spectacularly clever problem from those folks at MGMAT.

Here's a blog you may find helpful on function notation:
http://magoosh.com/gmat/2012/function-n ... -the-gmat/

Notice that for this particular function, when f(n) has an even input, it yields an odd output, and vice versa: when it has an odd input, it yield an even output.

Statement #1:
Well, if a is even, then f(a) = 2a - 7, which will be odd, and f(f(a)) = 3(2a - 7) - 9 = 6a - 30.
Then, if f(f(a)) = a, we have
6a - 30 = a
5a = 30
a = 6
That's one possible value.
If a is odd, then f(a) = 3a - 9, which will be even, and f(f(a)) = 2(3a - 9) - 7 = 6a - 25
Then, if f(f(a)) = a, we have
6a - 25 = a
5a = 25
a = 5
That's also one possible value.
This statement yields two possible values, so no definitive answer to the prompt. This statement, alone and by itself, is insufficient.

Statement #2:
If f(f(f(a))) is odd,
then f(f(a)) is even,
and f(a) is odd,
and a is even.
This tells us that a is even, but a could be any even number.
This statement yields no definitive answer to the prompt. This statement, alone and by itself, is insufficient.

Combined
We have two values from statement #1. From statement #2, we know a must be even. This means that a = 6. Now, we can give a definitive answer to the prompt question. Combined, the statements are sufficient.

Does all this make sense?
Mike

Hi Mike,

is there a reason why choosing numbers here doesn't work or isn't optimal?

I tried use 5,6 and 7,8 and my values are all over?

Thanks
Magoosh GMAT Instructor
Joined: 28 Dec 2011
Posts: 4487
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

11 May 2014, 22:27
russ9 wrote:
Hi Mike,

is there a reason why choosing numbers here doesn't work or isn't optimal?

I tried use 5, 6 and 7, 8 and my values are all over?

Thanks

Dear russ9
Think about the prompt question, "What is the value of a?" It may be that a has just one value, or more than one. If you find one value, that's absolutely no guarantee that there aren't other values that also work. Suppose, for the sake of argument, that the two values that worked were a = 6 and a = 50 --- plugging in numbers for some single digit cases would never tell you that there's more than one answer. Do you see what I mean?

Remember, GMAT DS is NOT about "find the answer" --- it's more about "is it possible to find a unique and sensible answer?" If you were looking for one and only one answer, then plugging in numbers would make sense --- that might not be so bad on GMAT PS. But on GMAT DS, that misses the point in a problem such as this.

Does this make sense?
Mike
_________________
Mike McGarry
Magoosh Test Prep

Education is not the filling of a pail, but the lighting of a fire. — William Butler Yeats (1865 – 1939)
Manager
Joined: 15 Aug 2013
Posts: 239
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

15 May 2014, 17:22
mikemcgarry wrote:
russ9 wrote:
Hi Mike,

is there a reason why choosing numbers here doesn't work or isn't optimal?

I tried use 5, 6 and 7, 8 and my values are all over?

Thanks

Dear russ9
Think about the prompt question, "What is the value of a?" It may be that a has just one value, or more than one. If you find one value, that's absolutely no guarantee that there aren't other values that also work. Suppose, for the sake of argument, that the two values that worked were a = 6 and a = 50 --- plugging in numbers for some single digit cases would never tell you that there's more than one answer. Do you see what I mean?

Remember, GMAT DS is NOT about "find the answer" --- it's more about "is it possible to find a unique and sensible answer?" If you were looking for one and only one answer, then plugging in numbers would make sense --- that might not be so bad on GMAT PS. But on GMAT DS, that misses the point in a problem such as this.

Does this make sense?
Mike

Makes total sense. Thanks, Mike!
Current Student
Joined: 23 Jul 2015
Posts: 152
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

03 Jul 2017, 08:31
Given: f(n) = 3n-9 when n is odd
--> f(n) = O*O - O = O - O =E
--> f(n) is even when n is odd

F(n) = 2n -7 when n is even
--> f(n) = e* e - o = e - o = o
--> f(n) is odd when n is even

f(n) changes n from even to odd and from odd to even

1. f(f(a) = a

when a is even
f(f(a)) = 3(2a - 7) - 9
= 6a -21 -9 = 6a - 30

when a is odd
f(f(a)) = 2 (3a - 9) - 7
=6a - 18 - 7 =6a - 25

Depending on the odd/even nature of a, value of function changes. Thus, insuff.

2. f(f(f(a))) is odd. This tells us whether a is even or odd. Insuff.

1 & 2 :
we now now which formula to use from stmt 1 --> suff.
Senior Manager
Joined: 29 Jun 2017
Posts: 448
GPA: 4
WE: Engineering (Transportation)
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

08 Jan 2018, 07:04
Refer to the pic attached.

Attachments

IMG_1694.jpg [ 1.47 MiB | Viewed 3998 times ]

_________________
Give Kudos for correct answer and/or if you like the solution.
SVP
Joined: 12 Dec 2016
Posts: 1524
Location: United States
GMAT 1: 700 Q49 V33
GPA: 3.64
The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

08 Jan 2018, 07:19
it took me 3 min.
After I have found the answer, I note that st 1 helps to solve the st 2.
In other words, st 1 gives value while st 2 only limits to one certain value.

VeritasPrepKarishma, chetan2u IMPORTANT: IF THERE IS NO VALUE FOR A, THEN E IS THE ANSWER. (am i correct? )
Math Expert
Joined: 02 Aug 2009
Posts: 7764
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

08 Jan 2018, 09:12
1
chesstitans wrote:
it took me 3 min.
After I have found the answer, I note that st 1 helps to solve the st 2.
In other words, st 1 gives value while st 2 only limits to one certain value.

VeritasPrepKarishma, chetan2u IMPORTANT: IF THERE IS NO VALUE FOR A, THEN E IS THE ANSWER. (am i correct? )

Hi..

yes, if there are no value from statement I , ans will be E..
and that could happen if say the value has $$a^2$$ instead of a that is $$F(a)=3a^2-4$$... then you may land up with more than 2 values from statement 1...

Just two points which will help in answering the Q
1) the function is LINEAR, so it will give you one value
2) F(odd) is even and F(even) is odd...

if you are able to get to above two points, you will understand that there can be ONLY one value if x is ODD and one value when x is even.
and statement II will tell you whether a is odd or even..
_________________
Manager
Joined: 29 Nov 2016
Posts: 140
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

03 Mar 2018, 06:18
Hi.

For many similar problems, I can solve them but m not able to do it under two minutes. Any advice?

Thanks

Posted from my mobile device
Math Expert
Joined: 02 Sep 2009
Posts: 56257
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

05 Mar 2018, 01:20
Mudit27021988 wrote:
Hi.

For many similar problems, I can solve them but m not able to do it under two minutes. Any advice?

Thanks

Posted from my mobile device

13. Functions

5. Strategies and Tactics To Increase Your Score

6. Strategies and Tactics To Speedd-Up

[/list]

For more check below:
ALL YOU NEED FOR QUANT ! ! !

Hope it helps.
_________________
Intern
Joined: 05 Jan 2019
Posts: 22
Location: Spain
GMAT 1: 740 Q49 V42
Re: The function f is defined for all positive integers n > 4 as  [#permalink]

### Show Tags

11 Mar 2019, 06:48
mikemcgarry wrote:
Rock750 wrote:
The function f is defined for all positive integers n > 4 as f(n) = 3n – 9 if n is odd and f(n) = 2n – 7 if n is even. What is the value of the positive integer a?

(1) f(f(a)) = a

(2) f(f(f(a))) is odd.

I'm happy to help. As usual, this is a spectacularly clever problem from those folks at MGMAT.

Here's a blog you may find helpful on function notation:
http://magoosh.com/gmat/2012/function-n ... -the-gmat/

Notice that for this particular function, when f(n) has an even input, it yields an odd output, and vice versa: when it has an odd input, it yield an even output.

Statement #1:
Well, if a is even, then f(a) = 2a - 7, which will be odd, and f(f(a)) = 3(2a - 7) - 9 = 6a - 30.
Then, if f(f(a)) = a, we have
6a - 30 = a
5a = 30
a = 6
That's one possible value.
If a is odd, then f(a) = 3a - 9, which will be even, and f(f(a)) = 2(3a - 9) - 7 = 6a - 25
Then, if f(f(a)) = a, we have
6a - 25 = a
5a = 25
a = 5
That's also one possible value.
This statement yields two possible values, so no definitive answer to the prompt. This statement, alone and by itself, is insufficient.

Statement #2:
If f(f(f(a))) is odd,
then f(f(a)) is even,
and f(a) is odd,
and a is even.
This tells us that a is even, but a could be any even number.
This statement yields no definitive answer to the prompt. This statement, alone and by itself, is insufficient.

Combined
We have two values from statement #1. From statement #2, we know a must be even. This means that a = 6. Now, we can give a definitive answer to the prompt question. Combined, the statements are sufficient.

Does all this make sense?
Mike

Hi Mike,

What is the reason behind the The function f is defined for all positive integers n > 4... part?

I'm not able to understand it.

Thanks!
Re: The function f is defined for all positive integers n > 4 as   [#permalink] 11 Mar 2019, 06:48
Display posts from previous: Sort by


text:
Home > Error Propagation > Propagation Of Error Using Standard Deviation

Propagation Of Error Using Standard Deviation

Contents

Taking the error variance to be a function of the actual weight makes it "heteroscedastic". more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed ISBN0470160551.[pageneeded] ^ Lee, S. Can I only touch other creatures with spells such as Invisibility? have a peek at this web-site

sigma-squareds) for convenience and using Vx, Vy, Ve, VPx, VPy, VPe with what I hope are the obvious meanings, your equation reads: VPx = VPy - VPe If there are m For example, I have three samples, each of which I take two measurements of. JCGM 102: Evaluation of Measurement Data - Supplement 2 to the "Guide to the Expression of Uncertainty in Measurement" - Extension to Any Number of Output Quantities (PDF) (Technical report). Hey rano and welcome to the forums. https://en.wikipedia.org/wiki/Propagation_of_uncertainty

Error Propagation Calculator

Suppose we want to know the mean ± standard deviation (mean ± SD) of the mass of 3 rocks. Can anyone help? Any insight would be very appreciated. We weigh these rocks on a balance and get: Rock 1: 50 g Rock 2: 10 g Rock 3: 5 g So we would say that the mean ± SD of

• Please try the request again.
• H. (October 1966). "Notes on the use of propagation of error formulas".
• So you see, you get a correction term using differences between the group means and the overall mean.
• Generally, reported values of test items from calibration designs have non-zero covariances that must be taken into account if b is a summation such as the mass of two weights, or
• R., 1997: An Introduction to Error Analysis: The Study of Uncertainties in Physical Measurements. 2nd ed.

Retrieved 13 February 2013. If instead you had + or -2, you would adjust your variance. The second thing I gathered is that I'm not sure if this is even a valid question since it appears as though I am comparing two different measures. Error Propagation Excel I have looked on several error propagation webpages (e.g.

Would combining all German articles to just one article have a real negative effect on the language? This example will be continued below, after the derivation (see Example Calculation). Peter Blake 185 προβολές 11:14 NM1.6 - Propagation of Relative Error with Approximations - Διάρκεια: 10:39. From your responses I gathered two things.

it's a naming thing, the standard deviation definition/estimation is unfortunately a bit messy since I see it change from book to book but anyway, I should have said standard deviation myself Error Propagation Average doi:10.6028/jres.070c.025. Foothill College. The area $$area = length \cdot width$$ can be computed from each replicate.

Error Propagation Physics

I'll give this some more thought... https://www.physicsforums.com/threads/error-propagation-with-averages-and-standard-deviation.608932/ The answer to this fairly common question depends on how the individual measurements are combined in the result. Error Propagation Calculator The derivative of f(x) with respect to x is d f d x = 1 1 + x 2 . {\displaystyle {\frac {df}{dx}}={\frac {1}{1+x^{2}}}.} Therefore, our propagated uncertainty is σ f Error Propagation Chemistry viraltux, May 25, 2012 May 25, 2012 #3 haruspex Science Advisor Homework Helper Insights Author Gold Member viraltux said: ↑ You are comparing different things, ...

We weigh these rocks on a balance and get: Rock 1: 50 g Rock 2: 10 g Rock 3: 5 g So we would say that the mean ± SD of http://doinc.org/error-propagation/propagation-error-calculating-standard-deviation.html The best you can do is to estimate that σ. as follows: The standard deviation equation can be rewritten as the variance ($$\sigma_x^2$$) of $$x$$: $\dfrac{\sum{(dx_i)^2}}{N-1}=\dfrac{\sum{(x_i-\bar{x})^2}}{N-1}=\sigma^2_x\tag{8}$ Rewriting Equation 7 using the statistical relationship created yields the Exact Formula for Propagation of p.5. Error Propagation Definition

JSTOR2629897. ^ a b Lecomte, Christophe (May 2013). "Exact statistics of systems with uncertainties: an analytical theory of rank-one stochastic dynamic systems". The equation for molar absorptivity is ε = A/(lc). But in this case the mean ± SD would only be 21.6 ± 2.45 g, which is clearly too low. Source David Urminsky 1.569 προβολές 10:29 Error Propagation - Διάρκεια: 7:27.

Confusing PAD layout in datasheet DDoS ignorant newbie question: Why not block originating IP addresses? Error Propagation Calculus What does the skull represent next to an enemy's health bar? Management Science. 21 (11): 1338–1341.

If you like us, please shareon social media or tell your professor!

All three samples will have the same standard deviation if they are supposed identical. doi:10.1287/mnsc.21.11.1338. We know the value of uncertainty for∆r/r to be 5%, or 0.05. Propagation Of Errors Pdf Stay logged in Physics Forums - The Fusion of Science and Community Forums > Mathematics > Set Theory, Logic, Probability, Statistics > Menu Forums Featured Threads Recent Posts Unanswered Threads Videos

Harry Ku (1966). You're right, rano is messing up different things (he should explain how he measures the errors etc.) but my point was to make him see that the numbers are different because Any insight would be very appreciated. http://doinc.org/error-propagation/propagation-of-error-vs-standard-deviation.html Or in matrix notation, f ≈ f 0 + J x {\displaystyle \mathrm σ 6 \approx \mathrm σ 5 ^ σ 4+\mathrm σ 3 \mathrm σ 2 \,} where J is

For highly non-linear functions, there exist five categories of probabilistic approaches for uncertainty propagation;[6] see Uncertainty Quantification#Methodologies for forward uncertainty propagation for details. Generated Mon, 24 Oct 2016 19:46:55 GMT by s_wx1157 (squid/3.5.20) What a resource! How can you state your answer for the combined result of these measurements and their uncertainties scientifically?

GUM, Guide to the Expression of Uncertainty in Measurement EPFL An Introduction to Error Propagation, Derivation, Meaning and Examples of Cy = Fx Cx Fx' uncertainties package, a program/library for transparently We will treat each case separately: Addition of measured quantities If you have measured values for the quantities X, Y, and Z, with uncertainties dX, dY, and dZ, and your final How did you get 21.6 ± 24.6 g, and 21.6 ± 2.45 g, respectively?! Your cache administrator is webmaster.


text:
# Staking Rewards

⛏ Meta Governors earn an income to compensate them for their voting decisions, responsibility, and risk

# Why?

To incentivise sound decision making, Meta Governors will be rewarded when mStable grows securely and are partially liquidated as part of Recollateralisation.

To participate as a Meta Governor, token holders must stake their MTA and participate in governance decisions. MTA holders who choose to stake their MTA will be partially liquidated in the event of a Recollateralisation. In return, those who stake may be rewarded for their risk in MTA, interest, and other fees that the platform collects. Ultimately, these rewards will be decided by the governors themselves once mStable reaches sufficient decentralisation.

This staking reward may be a floating value, and if so will change dependent on how much MTA is staked versus the fees and interest the platform receives. We expect the staking return to increase as the mStable platform matures, with return approaching an equilibrium that reflects the perceived risk of a re-collateralisation event taking place, the opportunity cost of that Meta, plus some liquidity premium.

# Example

Our user has 1,000 Meta that they wish to stake. As soon as this user stakes their Meta and participates in governance decisions, she begins to earn rewards from fees and interest on the platform alongside a portion of MTA allocated to staking (if there is any) as decided by governors. Her staked Meta entitles the user to a share of fees equal to the portion of Meta staked relative to the total amount staked. Our user stakes her 1,000 Meta over a month, with 1 million Meta staked in the total system, during a month where 50,000 mUSD in fees and interest are collected in the mStable ecosystem allocated to Meta stakers. 10,000 MTA has also been allocated as staking rewards. She calculates her return with the following formula:

$return = s/S ⋅ (Fm+Fs)$

where:

• s = amount of Meta staked by user

• S = Total amount of Meta staked in the system

• Fm = Income from fees and interest collected over the month directed to Meta (mUSD)

• Fs = MTA allocated to staking reward over the period

Substituting our values in, we can calculate our user's staking return:

$return = 1,000/1,000,000 ⋅ (50,000+10,000 Meta)$

Our user staked 1,000 Meta for a month, and received a 50 mUSD and 10 MTA as a monthly return for doing so.

• Cost: Gas, opportunity cost of Meta

• Risk: partial liquidation in event of a bASSET losing its peg

• Reward: staking return

It is worth noting that since the amount of Meta staked in the system changes, return will be dynamic, changing in response to Meta being staked and withdrawn. It may also change in response to governance decisions that alter staking rewards. Our example assumes a fixed amount of total Meta staked in the system for simplicity.

Contents
Why?
Example