text:
Sunday, 28 October 2012

Survival analysis with time varying covariates measured at random times by design

Stephen Rathbun, Xiao Song, Benjamin Neustiftler and Saul Shiffman have a new paper in Applied Statistics (JRSS C). This considers estimation of a proportional hazards survival model in the presence of time dependent covariates which are only intermittently sampled at random time points. Specifically they are interested in examples relating to ecological momentary assessment where data collection may be via electronic devices like smart phones and the decision on sampling times can be automated. They consider a self-correcting point-process sampling design, where the intensity of the sampling process depends on the past history of sampling times, which allows an individual to have random sampling times that are more regular than would be achieved from a Poisson process.

The proposed method of estimation is to use inverse intensity weighting to obtain an estimate of an individual's integrated hazard up to the event time. Specifically the estimator is $\hat{H}_i(T_i) = \sum_{j=1}^{N_i} h_i(u_{ij}) \pi^{-1}_i(u_{ij})$ for a individual with $\inline N_i$ sampling times at times $\inline 0 \leq u_{ij} \leq T_i$ and point process sampling intensity $\inline \pi(t)$. This then replaces the integrated hazard in an approximate log-likelihood.

In part of the simulation study and in an application the exact point process intensity is unknown and taken from empirical estimates from the sample. Estimating the sampling intensity didn't seem to have major consequences on the integrity of the model estimates. This seems to suggest the approach might be applicable in other survival models where the covariates are sampled longitudinally in a subject specific manner, provided a reasonable model for sampling can be devised.

Drawbacks of the method seem to be that covariates measured at baseline (which is not a random time point) cannot be incorporated in the estimate and that it seems that the covariates must be measured at the event time which may not be the case in medical contexts. The underlying hazard also needs to be specified parametrically, but as stated flexible spline modelled can be used.


text:
CSES - Binomial Coefficients
• Time limit: 1.00 s
• Memory limit: 512 MB
Your task is to calculate $n$ binomial coefficients modulo $10^9+7$.

A binomial coefficient ${a \choose b}$ can be calculated using the formula $\frac{a!}{b!(a-b)!}$. We assume that $a$ and $b$ are integers and $0 \le b \le a$.

Input

The first input line contains an integer $n$: the number of calculations.

After this, there are $n$ lines, each of which contains two integers $a$ and $b$.

Output

Print each binomial coefficient modulo $10^9+7$.

Constraints
• $1 \le n \le 10^5$
• $0 \le b \le a \le 10^6$
Example

Input:
3
5 3
8 1
9 5

Output:
10
8
126

format: plain


text:
# Upsampling - What purpose does the interpolation filter have?

I want to apply some nonlinear processing to a signal, namely: I want to implement a tube emulation which adds warmth/harmonic distortion to a digital audio signal. I am worried about aliasing, so I figured out the following processing sequence:

• Upsampling of the sample rate from $f_s$ to $2 \cdot f_s$
• Applying an interpolation lowpass filter with $f_g = 0.5 f_s$ and a passband gain of $2$
• Applying the nonlinear processing to the upsampled signal
• Again applying a filter with with $f_g = 0.5 f_s$
• Decimation back to $fs$.

My question arises at point 2, the interpolation filter. If I google this topic, it results in fascinating concepts like Lagrange interpolation, spline interpolation and polynominal interpolation and the math behind those seem far from trivial. Moreover, I don't understand why this is even needed - what is the reason why one would utilize one of those concepts rather than just running the signal through a run-off-the-mill IIR with sufficient stopband attenuation? The only thing I can understand is why the passband gain needs to be non-unity.

Also, although not main point of my question, feel free to point out any logical flaws that might be in my processing sequence. Thank you!

In step 1 you insert a zero-valued sample between each pair of successive original samples. This is a gain 0.5 operation. For example consider 0 Hz. You can calculate the signed 0 Hz amplitude or direct current (DC) offset simply as the mean of the sample values. Inserting the zero samples halves the mean, so the gain is 0.5, which you need to compensate for by a gain of 2.

Your 2x-oversampled samples represent values of the continuous band-limited signal exactly at the times of the original samples or exactly half-way between them. As you suggest, in step 2 you can use a discrete-time filter, which can be a finite-impulse-response (FIR) or an infinite-impulse-response (IIR) filter. If you would have an arbitrary real oversampling ratio such as 3.12897684124, you couldn't use a discrete-time filter, but would have to resort to continuous-time interpolation, which can be done using piece-wise polynomial splines.

• Thanks for the answer. So just to be clear: Since I'm upsampling by an integer factor, the only purpose this interpolation filter does have is to reject any artifacts above 0.5 of original sample rate that apperar after upsampling, plus correction of the passband gain. To do so, I can utilize any type of lowpass filter that fits my overall system requirements best (in my specific case: real-time, no delay, no filter ringing -> high-order Butterworth IIR). Is this a correct summary? – UnbescholtenerBuerger Jun 5 '17 at 12:19
• That sounds correct. Zero stuffing leaves spectral images which you filter out, and non-linear processing will also spread the spectrum, so you filter again. (I'd also consider minimum-phase FIR). – Olli Niemitalo Jun 5 '17 at 16:54

Short answer: you need interpolation to get rid of mirror spectra in the frequency domain.

Long answer: Let's assume $f_s = 48kHz$ to make the discussion easier.

Initially your frequency range goes from from -24kHz to +24kHz. After up-sampling your frequency range goes up to 48kHz. The key question is what happens to the new frequencies?

If you up-sample by inserting zeros, you get a periodic repetition of the spectrum. So the spectrum you have from -24kHz to 0kHz simply gets repeated from +24kHz to +48kHz. That's sort inverse aliasing.

However the spectrum that you want, is that of the original signal where the range from 24 kHz to 48kHz should be zero. So you need to cut that off with a low-pass filter. That's what an interpolation filter does: any time invariant interpolation is essentially a low pass filter.

An ideal filter would be a sinc function in the time domain, which is non-causal and of infinite length. That's not practical so a more realistic filter needs to be designed. In most cases, that's best done by formulating the requirements in the frequency domain: who much attenuation at what frequencies, how much ripple can you tolerate, do you care about phase etc.

• non-causal ain't such a problem if a little delay is allowed. symmetric and infinite length is a problem. the easiest way i go about designing FIR interpolation filters is to assume finite length, even symmetry, and not worry about causality until the implementation. – robert bristow-johnson Jun 3 '17 at 11:45

You can actually use an IIR with appropriate attenuation. However, if you don't need realtime processing, it would be typical to run your signal through the IIR twice: once in forward, and once in backward direction, in order to get a net phase delay of zero. For realtime processing, reverse-time IIR is not feasible, so instead one tends to pitch for some compromise between linear phase and minimal phase.

Lagrange, spline, polynomial interpolation as such are not really lowpass filters. At best they can be mathematical tools useful for designing such lowpass filters under the constraints of realtime processing.

• Lagrange, spline (do you mean Hermite polynomials), and such are low-pass filters. they are LTI and they display a low-pass function in the frequency domain. – robert bristow-johnson Jun 3 '17 at 10:42
• actually Powell and Chau long ago suggested a way of doing filtfilt() (the reverse-time IIR) in real time using blocks of samples. it has a lotta delay but it's feasible. – robert bristow-johnson Jun 3 '17 at 11:49


text:
×

Eh whenever I post solutions with latex it just keeps leaving a line like this: Hello I am not $999^7$ years old. As you can see, a line is left specially for the latex. HOW DO I SOLVE THIS!

Edit: Use $$999$$ instead of $999$

Note by Joshua Ong
3 years ago

Sort by:

I edited your note to show you the difference between \ ( code \ ) and \ [ code \ ] (no spaces). Staff · 3 years ago


text:
# Math 210 - Spring 2018: Term Project suggestions

### Description of the term project

The term project part of the course consists of working with a group of four other students on a paper about a mathematical topic which you will present to the class.

Class presentations should be about 25 minutes long, so that we can have two presentations on a given day. The combination of your presentation and the paper you write with other members of your project team will count for 25 per cent grade.

Please have a look at the list of projects below and e-mail me an ordered list of your first three choices. I will then put people in touch with other class members interested in the same project. We will also set up a time so that everyone can meet with me to discuss their project. If you think of a mathematical project not on this list which you'd like to pursue, that would be fine. Please e-mail me about what you have in mind and we will meet to discuss this.

## An example of a presentation and write-up

In 2012 a group of students in math 210 decided to study the prevalence of the golden ratio in a particular painting by Mondrian. They modeled what the distribution of heights in comparison to widths in a painting which contained random" rectangles. They then compared this distribution with what the rectangles they saw in a painting of Mondrian. This gave some support to the idea that Mondrian did favor the golden ratio.

Here is their in-class presentation

Here is a write-up of their work.

## Possible term projects

1. ### The inverse B.S. problem

This problem is to determine to what extent the parameters in a 3 by 3 payoff matrix can be determined from knowing the optimal strategies in the two person zero sum game defined by this matrix. This is a natural question to ask when trying to understand from the behavior of the players what their motivations are. Suppose in the B.S. model discussed in homework #4, one allows the credibility constant c and the lying constant \ell to be different from each other. For which values of c and \ell are the values of c and \ell determined by the optimal strategies of the two players? You might first want to analyze the analogous problem for the 2 by 2 truth versus lying game.

2. ### The mathematics of choice

This project is about one model for how to make a choice from among a sequence of alternatives being considered. Imagine that you can interview a sequence of candidates for a job of some kind. After each interview you either have to decide to choose the candidate just interviewed or move on the next, and if you move on then you can't return to choose an earlier candidate. What is the best strategy to use if you want to maximize the chances of ending up with the best candidate? What if you want to maximize the expected rank of the candidate you choose? Here is a Survey on the secretary problem. Here is a More advanced article.

3. ### Mathematical sociology

This project has to do with trying to understand social behavior mathematically. Here is one example. Suppose that every pair of people in a group of people must declare whether they are enemies or friend. Suppose further that the friend of one's friend must be a friend, and the enemy of one's enemy must be one's friend. Finally suppose that no three people are all enemies of one another; in other words, an alliance between two of the three always develops. Then one can show the entire population can be divided into two groups, with members of each group being friends with members of the same group and enemies of all members of the other group.

4. ### The theory of information

This project is about Shannon's entropy function, which measures the expected amount of information in a message or inherent in a network. Conditional Shannon entropy measures how much more information is expected from a new message, given the data of messages already received. It would be interesting to apply these concepts to the media.

5. ### How not to be wrong

There are many potential final project topics in the new book How not to be wrong" by Jordan Elleberg. Some examples are: How some college students beat the Massachussetts state lottery and how Facebook could detect if your neighbor is a terrorist. If you find some chapters in this book interesting, send me an e-mail and we can talk about how to build a project around them. Since the book was written for a popular audience, we would need to augment this with some further mathematical details using what we have been doing in the course.

6. ### The evolution of cooperation

The game theory models which we have discussed in class generally considered situations in which two or more people would interact exactly once. If the same people interact many times, different strategies may become optimal. This project has to do with understanding the research on this topic and its relevance to social and biological behavior. Here is an untidy Wikipedia article about "The evolution of cooperation" by Robert Axelrod.
Last updated: 3/12/18


text:
# Tag Info

A small comment first: usually people call this theory as a Chern-Simons theory in (2+1)d, while the BF theory usually refers to a similar theory in (3+1)d. But anyways, this naming is not important. The U(1) Chern-Simons theory in (2+1)d is always formulated in the following general form $$S=\int\frac{\mathrm{i}}{4\pi}K^{IJ} a^I\wedge \mathrm{d}a^J.$$ The ...


text:
# Models and neuron groups¶

The core of every simulation is a NeuronGroup, a group of neurons that share the same equations defining their properties. The minimum NeuronGroup specification contains the number of neurons and the model description in the form of equations:

G = NeuronGroup(10, 'dv/dt = -v/(10*ms) : volt')

This defines a group of 10 leaky integrators. The model description can be directly given as a (possibly multi-line) string as above, or as an Equations object. For more details on the form of equations, see Equations. Note that model descriptions can make reference to physical units, but also to scalar variables declared outside of the model description itself:

tau = 10*ms
G = NeuronGroup(10, 'dv/dt = -v/tau : volt')

If a variable should be taken as a parameter of the neurons, i.e. if it should be possible to vary its value across neurons, it has to be declared as part of the model description:

G = NeuronGroup(10, '''dv/dt = -v/tau : volt
tau : second''')

To make complex model descriptions more readable, named subexpressions can be used:

G = NeuronGroup(10, '''dv/dt = I_leak / Cm : volt
I_leak = g_L*(E_L - v) : amp''')

Sometimes it can also be useful to introduce shared variables or subexpressions, i.e. variables that have a common value for all neurons. In contrast to external variables (such as Cm above), such variables can change during a run, e.g. by using run_regularly(). This can be for example used for an external stimulus that changes in the course of a run:

G = NeuronGroup(10, '''shared_input : volt (shared)
dv/dt = (-v + shared_input)/tau : volt
tau : second''')

Note that there are several restrictions around the use of shared variables: they cannot be written to in contexts where statements apply only to a subset of neurons (e.g. reset statements, see below). If a code block mixes statements writing to shared and vector variables, then the shared statements have to come first.

## Threshold and reset¶

To emit spikes, neurons need a threshold. Threshold and reset are given as strings in the NeuronGroup constructor:

tau = 10*ms
G = NeuronGroup(10, 'dv/dt = -v/tau : volt', threshold='v > -50*mV',
reset='v = -70*mV')

Whenever the threshold condition is fulfilled, the reset statements will be executed. Again, both threshold and reset can refer to physical units, external variables and parameters, in the same way as model descriptions:

v_r = -70*mV  # reset potential
G = NeuronGroup(10, '''dv/dt = -v/tau : volt
v_th : volt  # neuron-specific threshold''',
threshold='v > v_th', reset='v = v_r')

## Refractoriness¶

To make a neuron non-excitable for a certain time period after a spike, the refractory keyword can be used:

G = NeuronGroup(10, 'dv/dt = -v/tau : volt', threshold='v > -50*mV',
reset='v = -70*mV', refractory=5*ms)

This will not allow any threshold crossing for a neuron for 5ms after a spike. The refractory keyword allows for more flexible refractoriness specifications, see Refractoriness for details.

## State variables¶

Differential equations and parameters in model descriptions are stored as state variables of the NeuronGroup. They can be accessed and set as an attribute of the group. To get the values without physical units (e.g. for analysing data with external tools), use an underscore after the name:

>>> G = NeuronGroup(10, '''dv/dt = (-v + shared_input)/tau : volt
shared_input : volt (shared)
...                        tau : second''')
>>> G.v = -70*mV
>>> print G.v
<neurongroup.v: array([-70., -70., -70., -70., -70., -70., -70., -70., -70., -70.]) * mvolt>
>>> print G.v_  # values without units
<neurongroup.v_: array([-0.07, -0.07, -0.07, -0.07, -0.07, -0.07, -0.07, -0.07, -0.07, -0.07])>
>>> G.shared_input = 5*mV
>>> print G.shared_input
<neurongroup.shared_input: 5.0 * mvolt>

The value of state variables can also be set using string expressions that can refer to units and external variables, other state variables, mathematical functions, and a special variable i, the index of the neuron:

>>> G.tau = '5*ms + 5*ms*rand() + i*5*ms'
>>> print G.tau
<neurongroup.tau: array([  5.03593449,  10.74914808,  19.01641896,  21.66813281,
27.16243388,  31.13571924,  36.28173038,  40.04921519,
47.28797921,  50.18913711]) * msecond>

For shared variables, such string expressions can only refer to shared values:

>>> G.shared_input = 'rand()*mV + 4*mV'
>>> print G.shared_input
<neurongroup.shared_input: 4.2579690100000001 * mvolt>

Sometimes it can be convenient to access multiple state variables at once, e.g. to set initial values from a dictionary of values or to store all the values of a group on disk. This can be done with the Group.get_states() and Group.set_states() methods:

>>> group = NeuronGroup(5, '''dv/dt = -v/tau : 1
...                           tau : second''')
>>> initial_values = {'v': [0, 1, 2, 3, 4],
...                   'tau': [10, 20, 10, 20, 10]*ms}
>>> group.set_states(initial_values)
>>> group.v[:]
array([ 0.,  1.,  2.,  3.,  4.])
>>> group.tau[:]
array([ 10.,  20.,  10.,  20.,  10.]) * msecond
>>> states = group.get_states()
>>> states['v']
array([ 0.,  1.,  2.,  3.,  4.])
>>> sorted(states.keys())
['N', 'dt', 'i', 't', 'tau', 'v']

## Subgroups¶

It is often useful to refer to a subset of neurons, this can be achieved using slicing syntax:

G = NeuronGroup(10, '''dv/dt = -v/tau : volt
tau : second''',
threshold='v > -50*mV',
reset='v = -70*mV')
# Create subgroups
G1 = G[:5]
G2 = G[5:]

# This will set the values in the main group, subgroups are just "views"
G1.tau = 10*ms
G2.tau = 20*ms

Subgroups can be used in most places where regular groups are used, e.g. their state variables or spiking activity can be recorded using monitors, they can be connected via Synapses, etc. In such situations, indices (e.g. the indices of the neurons to record from in a StateMonitor) are relative to the subgroup, not to the main group

A NeuronGroup can define parameters that are not stored in this group, but are instead a reference to a state variable in another group. For this, a group defines a parameter as linked and then uses linked_var() to specify the linking. This can for example be useful to model shared noise between cells:

inp = NeuronGroup(1, 'dnoise/dt = -noise/tau + tau**-0.5*xi : 1')

neurons = NeuronGroup(100, '''noise : 1 (linked)
dv/dt = (-v + noise_strength*noise)/tau : volt''')

If the two groups have the same size, the linking will be done in a 1-to-1 fashion. If the source group has the size one (as in the above example) or if the source parameter is a shared variable, then the linking will be done as 1-to-all. In all other cases, you have to specify the indices to use for the linking explicitly:

# two inputs with different phases
inp = NeuronGroup(2, '''phase : 1
dx/dt = 1*mV/ms*sin(2*pi*100*Hz*t-phase) : volt''')
inp.phase = [0, pi/2]

neurons = NeuronGroup(100, '''inp : volt (linked)
dv/dt = (-v + inp) / tau : volt''')
# Half of the cells get the first input, other half gets the second
neurons.inp = linked_var(inp, 'x', index=repeat([0, 1], 50))

## Numerical integration¶

Differential equations are converted into a sequence of statements that integrate the equations numerically over a single time step. By default, Brian chooses an integration method automatically, trying to solve the equations exactly first (for linear equations) and then resorting to numerical algorithms. It will also take care of integrating stochastic differential equations appropriately. Each class defines its own list of algorithms it tries to apply, NeuronGroup and Synapses will use the first suitable method out of the methods 'linear', 'euler' and 'heun' while SpatialNeuron objects will use 'linear', 'exponential_euler', 'rk2' or 'heun'.

If you prefer to chose an integration algorithm yourself, you can do so using the method keyword for NeuronGroup, Synapses, or SpatialNeuron. The complete list of available methods is the following:

• 'linear': exact integration for linear equations
• 'independent': exact integration for a system of independent equations, where all the equations can be analytically solved independently
• 'exponential_euler': exponential Euler integration for conditionally linear equations
• 'euler': forward Euler integration (for additive stochastic differential equations using the Euler-Maruyama method)
• 'rk2': second order Runge-Kutta method (midpoint method)
• 'rk4': classical Runge-Kutta method (RK4)
• 'heun': stochastic Heun method for solving Stratonovich stochastic differential equations with non-diagonal multiplicative noise.
• 'milstein': derivative-free Milstein method for solving stochastic differential equations with diagonal multiplicative noise

You can also define your own numerical integrators, see State update for details.


text:
9.2.3 Loci in Two Dimensions, PT3 Focus Practice

Question 7:
Diagram below in the answer space shows a circle with centre O drawn on a grid of equal squares with sides of 1 unit. POQ is a diameter of the circle.
W, X and Y are three moving points inside the circle.
(a) W is the point which moves such that it is constantly 4 units from the point O. Describe fully the locus of W.
(b) On the diagram, draw,
(i) the locus of the point X which moves such that its distance is constantly 3 units from the line PQ,
(ii) the locus of the point Y which moves such that it is equidistant from the point P and the point Q.
(c) Hence, mark with the symbol $\otimes$ the intersection of the locus of X and the locus of Y.

(b)(i),(ii) and (c)

Solution:
(a) The locus of W is a circle with the centre O and a radius of 4 units.

(b)(i),(ii) and (c)

Question 8:
The diagram in the answer space shows two squares ABCD and CDEF each of sides 4 cm. K is a point on the line CD. W, X and Y are three moving points in the diagram.
(a) Point W moves such that it is always equidistant from the straight lines AB and EF. By using the letters in diagram, state the locus of W.
(b) On the diagram, draw
(i) the locus X such that it is always 2 cm from the straight line ACE,
(ii) the locus of Y such that KY = KC.
(c) Hence, mark with the symbol $\otimes$ the intersection of the locus of X and the locus of Y.

(b)(i), (ii) and (c)

Solution:
(a) The locus of W is the line CD.

(b)(i),(ii) and (c)

Question 9:
Diagram below shows a Cartesian plane.
Draw the locus of X, Y and Z.
(a) X is a point which moves such that its distance is constantly 4 units from the origin.
(b) Y is a point which moves such that it is always equidistant from point K and point L.
(c) Z is a point which moves such that it is always equidistant from lines KM and y-axis.

Solution:

9.2.2 Loci in Two Dimensions, PT3 Focus Practice

9.2.2 Loci in Two Dimensions, PT3 Focus Practice

Question 4:
Diagram below in the answer space shows a quadrilateral ABCD drawn on a grid of equal squares with sides of 1 unit.
X, Y and Z are three moving points inside the quadrilateral ABCD.
(a) X is the point which moves such that it is always equidistant from point B and point D.
By using the letters in diagram, state the locus of X.
(b) On the diagram, draw,
(i) the locus of the point Y such that it is always 6 units from point A,
(ii) the locus of the point Z which moves such that its distance is constantly 3 units from the
line AB.
(c) Hence, mark with the symbol ⊗ the intersection of the locus of Y and the locus of Z.

:
(b)(i),(ii) and (c)

Solution
:
(a) The locus of X is the line AC.

(b)(i),(ii) and (c)

Question 5:
Diagram in the answer space below shows a square ABCD. E, F, G and H are the midpoints of straight lines AD, AB, BC and CD respectively. W, X and Y are moving points in the square.
On the diagram,
(a) draw the locus of the point W which moves such that it is always equidistant from point AD and BC.
(b)   draw the locus of the point X which moves such that XM = MG.
(c) draw the locus of point Y which moves such that its distance is constantly 6 cm from point C.
(d)   Hence, mark with the symbol ⊗  the intersection of the locus of W and the locus of Y.

:
(a), (b), (c) and (d)

Solution
:

Question 6:
Diagram in the answer space below shows a polygon ABCDEF drawn on a grid of squares with sides of 1 unit. X, Y and Z are the points that move in the polygon.
(a) X is a point which moves such that it is equidistant from point B and point F.
By using the letters in diagram, state the locus of X.
(b) On the diagram, draw
(i) the locus of the point Y which moves such that it is always parallel and equidistant from the straight lines BA and CD.
(ii) the locus of point Z which moves such that its distance is constantly 6 units from the point A.
(c) Hence, mark with the symbol $\otimes$ the intersection of the locus of Y and the locus of Z.

(b)(i), (ii) and (c)

Solution:
(a) The locus of X is AD.

(b)(i),(ii) and (c)

9.2.1 Loci in Two Dimensions, PT3 Focus Practice

9.2.1 Loci in Two Dimensions, PT3 Focus Practice

Question 1:
Diagram below in the answer space shows a square PQRS with sides of 6 units drawn on a grid of equal squares with sides of 1 unit. W, X and Y are three moving points inside the square.
(a) W is the point which moves such that it is always equidistant from point P and point R.
By using the letters in diagram, state the locus of W.
(b) On the diagram, draw,
(i) the locus of the point X which moves such that it is always equidistant from the straight lines PQ and PS,
(ii) the locus of the point Y which moves such that its distance is constantly 2 units from point K.
(c) Hence, mark with the symbol ⊗ the intersection of the locus of X and the locus of Y.

:
(b)(i),(ii)
Solution:
(a) QS

(b)(i),(ii)
(c)

Question 2:
Diagram in the answer space below, shows a regular pentagon PQRST. W, X and Y are moving points which move in the pentagon.
On the diagram,
(a) draw the locus of the point W which moves such that it is always equidistant from point R and S.
(b) draw the locus of the point X which moves such that XR = RS.
(c) draw the locus of point Y which moves such that its distance is constantly 3 cm from the line SR.
(d) hence, mark with the symbol ⊗ the intersection of the locus of W and the locus of X.

:
(a), (b), (c) and (d)

Solution:
(a), (b), (c) and (d)

Question 3:
Diagram in the answer space below shows a polygon. X and Y are two moving points in the polygon.
(a) On the diagram, draw
(i) the locus of the point X such that XQ = XR.
(ii) the locus of the point Y such that YQ = QR.
(b) Hence, mark with the symbol $\otimes$ the intersection of the locus of X and the locus of Y.