text:
# General Enzymatic Kinetics

Enzymes are catalysts, most are proteins, that bind temporarily to one or more of the reactants of the reaction they catalyze. In doing so, they lower the amount of activation energy needed and thus speed up the reaction.

### Introduction

Enzymes are Agents of Metabolic Function. A given Enzyme is quite selective, both in the substances with which it interacts and in the reaction it catalyzes. The substances upon which an enzyme acts are called Substrates. The selective qualities of an enzyme are recognized as its specificity.The specific site on the enzyme where substrates bind and where catalysis occurs is called the Active site

• Catalysts lower the Free energy of Activation for a reaction given by the Arrhenius Equation: $$k = Ae^{-E_a/RT}$$

### Can the rate of an Enzyme-catalyzed Reaction be defined in a mathematical way?

Enzymes Kinetics exhibit the following rates of chemical reactions:

We seek to determine the maximum reaction velocity that an enzyme can attain and its binding affinity for substrates and inhibitors. When working with enzyme catalyzed reactions, generally the enzyme is less than the total substrate, so that it is a valid assumption that the concentration of free substrate concentration is equal to the TOTAL AMOUNT OF SUBSTRATE

$[E] << [S]_{total}$

$[S]_{free} = [S]_{total}$

We will use this assumption throughout the discussion of enzyme kinetics.

• Most frequently one takes the phrase "enzyme kinetics" refers to the analysis of the "steady state" kinetics of enzymatic reactions. The term "steady state" has a specific meaning. The steady state is the phase of a reaction in which reactive intermediates are both formed and decomposed at the same rate so that their concentrations are essentially constant.

### Analogies are always helpful for an intuitive understanding

A good analogy is that an animal population can be in a Steady-state Approximation

• This occurs when the rate of birth and death are equal.

The "reactive intermediates" (the live animals in the population) are then in a 'steady state', with the most "stable" states being those of pre-birth and death. Consider the following chemical reaction:

$A + B \leftrightharpoons AB^* \leftrightharpoons C + D$

• If the $$AB^*$$ complex is a high energy species relative to the $$A + B$$ and $$C + D$$ ground states then, as a good approximation, as soon as it is formed it will either go to $$A + B$$ or $$C + D$$. This means that it's concentration will be very low and nearly constant over a very large part of the reaction.
• The idea of steady state kinetics applied to enzyme catalyzed reactions is that the enzyme is generally present only in very low concentrations relative to the total substrate concentration, and that the reactive intermediate corresponding to $$AB^*$$ above is the $$E^*S$$ complex.

### Basic Equations of Enzyme Kinetics

$$E + S \leftrightharpoons E^*S \rightleftharpoons E + P$$

The typical mechanism for enzyme kinetics:

Enzyme + Substrate goes to the Enzyme Substrate Complex, and further yields Enzyme and Substrate!

• If $$[S]_{total} >> [E]_{total}$$, as is usually the case, then $$[S]$$ in the $$E^*S$$ complex is a very small portion or fraction of $$[S]_{total}$$.

This is a necessary condition for the steady state assumption to be valid: the reactive intermediate {{ math.formula("ES\) must be at a very low and constant concentration compared to the reactants {{ math.formula("S\).

• We generally miss the pre-steady state part of enzymatic reactions when we mix enzyme catalyzed reactions by hand in a cuvette and stick it in a spectrophotometer to measure it. By the time we start taking data, the reaction is already in the steady state because rate constants for enzyme catalyzed reactions are generally large.
• In 1913, Michaelis and Menten published the idea that enzymes and substrates formed reasonably stable complexes with their substrates that then subsequently undergo a reaction.

#### The BIG, BIG EQUATION FOR ENZYME KINETICS

The Michealis-Menten Equation

$E + S \leftrightharpoons E^*S \rightleftharpoons E + P$

The mechanism involves constants: KM (Michealis Constant) and kcat ( turnover number)

$v_o = \left(\dfrac{dP}{dt} \right )_o \dfrac{V_{max}[S]}{Km}{K_m + [S]}$

### References

1. Atkins, Peter and de Paula, Julio, 2006, Physical Chemistry for the Life Sciences, Oxford University Press.
2. Segel, Irwin H. , 1976, Biochemical Calculations: How to Solve Mathematical Problems in General Biochemistry, 2nd Edition
3. Segel, Irwin H., Enzyme Kinetics: Behavior and Analysis of Rapid Equilibrium and Steady-State Enzyme Systems (Wiley Classics Library)

• Jai Pal


text:
Notebook

# Nengo Example: Unsupervised learning

When we do error-modulated learning with the nengo.PES rule, we have a pretty clear idea of what we want to happen. Years of neuroscientific experiments have yielded learning rules explaining how synaptic strengths change given certain stimulation protocols. But what do these learning rules actually do to the information transmitted across an ensemble-to-ensemble connection?

We can investigate this in Nengo. Currently, we've implemented the nengo.BCM and nengo.Oja rules.

In [1]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

import nengo

<IPython.core.display.Javascript at 0x7f595903d5c0>

In [2]:
print(nengo.BCM.__doc__)

Bienenstock-Cooper-Munroe learning rule.

Modifies connection weights as a function of the presynaptic activity
and the difference between the postsynaptic activity and the average
postsynaptic activity.

Notes
-----
The BCM rule is dependent on pre and post neural activities,
not decoded values, and so is not affected by changes in the
size of pre and post ensembles. However, if you are decoding from
the post ensemble, the BCM rule will have an increased effect on
larger post ensembles because more connection weights are changing.
In these cases, it may be advantageous to scale the learning rate
on the BCM rule by 1 / post.n_neurons.

Parameters
----------
theta_tau : float, optional (Default: 1.0)
A scalar indicating the time constant for theta integration.
pre_tau : float, optional (Default: 0.005)
Filter constant on activities of neurons in pre population.
post_tau : float, optional (Default: None)
Filter constant on activities of neurons in post population.
If None, post_tau will be the same as pre_tau.
learning_rate : float, optional (Default: 1e-9)
A scalar indicating the rate at which weights will be adjusted.

Attributes
----------
learning_rate : float
A scalar indicating the rate at which weights will be adjusted.
post_tau : float
Filter constant on activities of neurons in post population.
pre_tau : float
Filter constant on activities of neurons in pre population.
theta_tau : float
A scalar indicating the time constant for theta integration.

In [3]:
print(nengo.Oja.__doc__)

Oja learning rule.

Modifies connection weights according to the Hebbian Oja rule, which
augments typicaly Hebbian coactivity with a "forgetting" term that is
proportional to the weight of the connection and the square of the
postsynaptic activity.

Notes
-----
The Oja rule is dependent on pre and post neural activities,
not decoded values, and so is not affected by changes in the
size of pre and post ensembles. However, if you are decoding from
the post ensemble, the Oja rule will have an increased effect on
larger post ensembles because more connection weights are changing.
In these cases, it may be advantageous to scale the learning rate
on the Oja rule by 1 / post.n_neurons.

Parameters
----------
pre_tau : float, optional (Default: 0.005)
Filter constant on activities of neurons in pre population.
post_tau : float, optional (Default: None)
Filter constant on activities of neurons in post population.
If None, post_tau will be the same as pre_tau.
beta : float, optional (Default: 1.0)
A scalar weight on the forgetting term.
learning_rate : float, optional (Default: 1e-6)
A scalar indicating the rate at which weights will be adjusted.

Attributes
----------
beta : float
A scalar weight on the forgetting term.
learning_rate : float
A scalar indicating the rate at which weights will be adjusted.
post_tau : float
Filter constant on activities of neurons in post population.
pre_tau : float
Filter constant on activities of neurons in pre population.

## Step 1: Create a simple communication channel

The only difference between this network and most models you've seen so far is that we're going to set the decoder solver in the communication channel to generate a full connection weight matrix which we can then learn using typical delta learning rules.

In [4]:
model = nengo.Network()
with model:
sin = nengo.Node(lambda t: np.sin(t * 4))

pre = nengo.Ensemble(100, dimensions=1)
post = nengo.Ensemble(100, dimensions=1)

nengo.Connection(sin, pre)
conn = nengo.Connection(
pre, post, solver=nengo.solvers.LstsqL2(weights=True))

pre_p = nengo.Probe(pre, synapse=0.01)
post_p = nengo.Probe(post, synapse=0.01)

In [5]:
# Verify that it does a communication channel
with nengo.Simulator(model) as sim:
sim.run(2.0)

plt.figure()
plt.plot(sim.trange(), sim.data[pre_p], label="Pre")
plt.plot(sim.trange(), sim.data[post_p], label="Post")
plt.ylabel("Decoded value")
plt.legend(loc="best");

/home/travis/build/nengo/nengo/nengo/builder/optimizer.py:636: UserWarning: Skipping some optimization steps because SciPy is not installed. Installing SciPy may result in faster simulations.
warnings.warn("Skipping some optimization steps because SciPy is "

## What does BCM do?

In [6]:
conn.learning_rule_type = nengo.BCM(learning_rate=5e-10)
with model:
weights_p = nengo.Probe(conn, 'weights', synapse=0.01, sample_every=0.01)

In [7]:
with nengo.Simulator(model) as sim:
sim.run(20.0)

In [8]:
plt.figure(figsize=(12, 8))
plt.subplot(2, 1, 1)
plt.plot(sim.trange(), sim.data[pre_p], label="Pre")
plt.plot(sim.trange(), sim.data[post_p], label="Post")
plt.ylabel("Decoded value")
plt.ylim(-1.6, 1.6)
plt.legend(loc="lower left")
plt.subplot(2, 1, 2)
# Find weight row with max variance
neuron = np.argmax(np.mean(np.var(sim.data[weights_p], axis=0), axis=1))
plt.plot(sim.trange(dt=0.01), sim.data[weights_p][..., neuron])
plt.ylabel("Connection weight");

The BCM rule appears to cause the ensemble to either be on or off. This seems consistent with the idea that it potentiates active synapses, and depresses non-active synapses.

As well, we can show that BCM sparsifies the weights. The sparsity measure below uses the Gini measure of sparsity, for reasons explained in this paper.

In [9]:
def sparsity_measure(vector):  # Gini index
# Max sparsity = 1 (single 1 in the vector)
v = np.sort(np.abs(vector))
n = v.shape[0]
k = np.arange(n) + 1
l1norm = np.sum(v)
summation = np.sum((v / l1norm) * ((n - k + 0.5) / n))
return 1 - 2 * summation

print(
"Starting sparsity: {0}".format(sparsity_measure(sim.data[weights_p][0])))
print("Ending sparsity: {0}".format(sparsity_measure(sim.data[weights_p][-1])))

Starting sparsity: 0.1814963710369274
Ending sparsity: 0.49317494715558463

## What does Oja do?

In [10]:
conn.learning_rule_type = nengo.Oja(learning_rate=6e-8)

In [11]:
with nengo.Simulator(model) as sim:
sim.run(20.0)

In [12]:
plt.figure(figsize=(12, 8))
plt.subplot(2, 1, 1)
plt.plot(sim.trange(), sim.data[pre_p], label="Pre")
plt.plot(sim.trange(), sim.data[post_p], label="Post")
plt.ylabel("Decoded value")
plt.ylim(-1.6, 1.6)
plt.legend(loc="lower left")
plt.subplot(2, 1, 2)
# Find weight row with max variance
neuron = np.argmax(np.mean(np.var(sim.data[weights_p], axis=0), axis=1))
plt.plot(sim.trange(dt=0.01), sim.data[weights_p][..., neuron])
plt.ylabel("Connection weight")
print(
"Starting sparsity: {0}".format(sparsity_measure(sim.data[weights_p][0])))
print("Ending sparsity: {0}".format(sparsity_measure(sim.data[weights_p][-1])))

Starting sparsity: 0.19409718470186865
Ending sparsity: 0.3004701154879499

The Oja rule seems to attenuate the signal across the connection.

## What do BCM and Oja together do?

We can apply both learning rules to the same connection by passing a list to learning_rule_type.

In [13]:
conn.learning_rule_type = [
nengo.BCM(learning_rate=5e-10), nengo.Oja(learning_rate=2e-9)
]

In [14]:
with nengo.Simulator(model) as sim:
sim.run(20.0)

In [15]:
plt.figure(figsize=(12, 8))
plt.subplot(2, 1, 1)
plt.plot(sim.trange(), sim.data[pre_p], label="Pre")
plt.plot(sim.trange(), sim.data[post_p], label="Post")
plt.ylabel("Decoded value")
plt.ylim(-1.6, 1.6)
plt.legend(loc="lower left")
plt.subplot(2, 1, 2)
# Find weight row with max variance
neuron = np.argmax(np.mean(np.var(sim.data[weights_p], axis=0), axis=1))
plt.plot(sim.trange(dt=0.01), sim.data[weights_p][..., neuron])
plt.ylabel("Connection weight")
print(
"Starting sparsity: {0}".format(sparsity_measure(sim.data[weights_p][0])))
print("Ending sparsity: {0}".format(sparsity_measure(sim.data[weights_p][-1])))

Starting sparsity: 0.17026107342919394
Ending sparsity: 0.4370418542023642

The combination of the two appears to accentuate the on-off nature of the BCM rule. As the Oja rule enforces a soft upper or lower bound for the connection weight, the combination of both rules may be more stable than BCM alone.

That's mostly conjecture, however; a thorough investigation of the BCM and Oja rules and how they interact has not yet been done.

Download learn_unsupervised as a Jupyter notebook or Python script.

format: plain


text:
GRAPH OF percentages

I want create a definite structure. It's a percentage chart.

This is my objective, I want to get this:

I try with this code

\documentclass[a4paper,twoside,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage{pgfplotstable}

\definecolor{color1}{rgb}{0.98, 0.81, 0.69}
\definecolor{color2}{rgb}{0.55, 0.71, 0.0}
\definecolor{color3}{rgb}{1.0, 0.6, 0.4}
\definecolor{color4}{rgb}{0.29, 0.59, 0.82}

\pgfplotscreateplotcyclelist{mycolor}{
{fill=color1!80, draw=color1},
{fill=color2!80, draw=color2},
{fill=color3!80, draw=color3},
{fill=color4!80, draw=color4},
}

\pgfplotsset{
x filter/.code={
\ifdim\thisrow{#1} pt=#2pt
\def\pgfmathresult{inf}
\fi
}
},
x filter/.code={
\ifdim\thisrow{#1} pt=#2pt
\else
\def\pgfmathresult{inf}
\fi
}
}
}

\begin{filecontents*}{coefficienti.dat}
T       K       Q       Kf      n
400     0.0463  32.9        5.78        0.321
500     0.124   24.8        6.30        0.275
600     0.115   24.6        6.30        0.261
700     1.64        24.4        11.9        0.151
\end{filecontents*}

\begin{document}

\begin{tikzpicture}
\begin{axis} [
ymin=0,
ybar=0, bar width=20, bar shift=0,
xtick={data},
ymajorgrids=true,
cycle list name=mycolor,
nodes near coords,
every node near coord/.append style = {
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision=3
}]

% first complete plot to place the x-axis labels
% the bars with different colors
\pgfplotsinvokeforeach{500,600,700}{
}
\end{axis}
\end{tikzpicture}

\end{document}

But in that base I can't writte text.

Someone can help me to create my percentage chart.

Any idea?

thank you very much

• Sorry, but the question is a bit unclear to me. Where do you want to have what? You mean you want to show the nodes near coords with percentage values? – Stefan Pinnow Aug 23 '18 at 10:01
• I want to get the graph of the first image [visa, mastercard etc]. Any idea? thank you very much – Vidal Aug 23 '18 at 10:04
• Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – Stefan Pinnow Aug 29 '18 at 19:10

It is simplest if you add the labels to the data file itself. Then you "only" need to change your code "a bit" so you get the desired result.

% used PGFPlots v1.16
\begin{filecontents*}{coefficienti.dat}
T       K       Q       Kf      n       xlables
400     0.0463  32.9    5.78    0.321   {VISA}
500     0.124   24.8    6.30    0.275   {MasterCard}
600     0.115   24.6    6.30    0.261   {American \\ Express}
700     1.64    24.4    11.9    0.151   {Union Pay \\ (China)}
\end{filecontents*}
\documentclass[border=5pt]{standalone}
\usepackage{pgfplotstable}
\definecolor{color1}{rgb}{0.98, 0.81, 0.69}
\definecolor{color2}{rgb}{0.55, 0.71, 0.0}
\definecolor{color3}{rgb}{1.0, 0.6, 0.4}
\definecolor{color4}{rgb}{0.29, 0.59, 0.82}

\pgfplotscreateplotcyclelist{mycolor}{
{fill=color1!80, draw=color1},
{fill=color2!80, draw=color2},
{fill=color3!80, draw=color3},
{fill=color4!80, draw=color4},
}
\pgfplotsset{
% changed definition of this style (so it works with \coordindex')
% suppress LOG messages about the filtered points
x filter/.expression={
#1 == #2 ? #1 : NaN
},
},
}
% load the table (because it is needed over and over again)
% store number of rows in table
\pgfmathtruncatemacro{\NoOfRows}{\pgfplotsretval}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
ymin=0,
ybar=0,
bar width=20,
bar shift=0,
% changing xtick' to this avoids the need for the dummy \addplot'
xtick={0,...,\NoOfRows},
% then you can use a table column to show the xticklabels'
% added so xticklabels' allow linebreaks
x tick label style={
align=center,
},
ymajorgrids=true,
cycle list name=mycolor,
% added value part of the key to be able to show the values as percentages
nodes near coords={\pgfmathprintnumber{\pgfplotspointmeta}\%},
every node near coord/.append style={
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision=2,
},
% adapt the axis line style
separate axis lines,
axis x line*=bottom,
axis y line=none,
]

\pgfplotsinvokeforeach{0,...,\NoOfRows}{
] table [
x expr=\coordindex,
y=K,
}
\end{axis}
\end{tikzpicture}
\end{document}

• is possible remove the black line rectangle? Sorry but it produce error in my texmaker :( – Vidal Aug 23 '18 at 12:16
• Sure. See my edited answer. – Stefan Pinnow Aug 23 '18 at 12:24
• nice!!! it's perfect thank you so much!! last thing, it possible to convert this graph in a image with standalone?? Now, i can't compilate the code :/ – Vidal Aug 23 '18 at 12:35
• I would guess so. But I am the wrong person to ask that, because I never do this. If I want to export the images I use PGFPlots external library (see tikz-external). I think you mean that you cannot compile the code anymore, right? What error message to you get? – Stefan Pinnow Aug 23 '18 at 13:27
• my error is about PGFPlots library. Can't compile the package. I think is better create an other design – Vidal Aug 24 '18 at 17:51

You can specify the text on the axis lables with xticklabels={Visa,Mastercard, American Express, Union Pay, JCB}

\documentclass[a4paper,twoside,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage{pgfplotstable}

\definecolor{color1}{rgb}{0.98, 0.81, 0.69}
\definecolor{color2}{rgb}{0.55, 0.71, 0.0}
\definecolor{color3}{rgb}{1.0, 0.6, 0.4}
\definecolor{color4}{rgb}{0.29, 0.59, 0.82}

\pgfplotscreateplotcyclelist{mycolor}{
{fill=color1!80, draw=color1},
{fill=color2!80, draw=color2},
{fill=color3!80, draw=color3},
{fill=color4!80, draw=color4},
}

\pgfplotsset{
x filter/.code={
\ifdim\thisrow{#1} pt=#2pt
\def\pgfmathresult{inf}
\fi
}
},
x filter/.code={
\ifdim\thisrow{#1} pt=#2pt
\else
\def\pgfmathresult{inf}
\fi
}
}
}

\begin{filecontents*}{coefficienti.dat}
T       K       Q       Kf      n
400     0.0463  32.9        5.78        0.321
500     0.124   24.8        6.30        0.275
600     0.115   24.6        6.30        0.261
700     1.64        24.4        11.9        0.151
\end{filecontents*}

\begin{document}

\begin{tikzpicture}
\begin{axis} [
ymin=0,
ybar=0, bar width=20, bar shift=0,
xtick={data},
xticklabels={Visa,Mastercard, American Express, Union Pay, JCB},
x tick label style={rotate=30,anchor=east},
ymajorgrids=true,
cycle list name=mycolor,
nodes near coords,
every node near coord/.append style = {
/pgf/number format/.cd,
fixed,
fixed zerofill,
precision=3
}]

% first complete plot to place the x-axis labels
`


text:
## Abstract:

Just about everything (creating Microsoft, Facebook, Twitter etc) today requires some form of programming - explaining to the computer what we wanted it to do for us. Learning by coding is complex and intimidating but clearly it also is advantageous in our digital-age world.

We conducted a 3 day, 2-3 hourly workshops to 15 students to “code” a rocket model-simulation, which inspired many of the secondary three express students to love rocket science.

Feedback from the students and teachers suggests the pedagogy of learn by coding, a rocket science example adapted from Open Source Physics is an exemplar learning approach.

## A: Challenge

Today’s technology giant creators like Bill Gates creator of Microsoft, Jack Dorsey creator of Twitter and Mark Zuckerberg creator of Facebook all started out by coding and they shared “What Most Schools Don't Teach”. The problem is in part that the Ordinary Level Physics syllabus does not explicitly recommend computational thinking (A Framework for K-12 Science Education: Practices, Crosscutting Concepts, and Core Ideas, 2012, p. 51) such as coding to model physics phenomena (Christian & Esquembre, 2007) that is increasingly becoming clear to be a necessary quality to be successful in the 21st century workforce (MOE, 2012).

In today’s computer age where computers are everywhere, it makes sense to equip students with some basic computer communication-language skills (coding) and modeling “equations in codes” to figure out the computer-digital world and in our lesson example, we got students to code to learn the basics of rocket science.

## B: Existing practices:

### B1: Scratch by Mitch Resnick

Some schools have Scratch by Mitch Resnick that allows students to learn the basics of computational thinking without coding and it is even in the MOE-CPDD formal design and technology curriculum recently. We did not adopt this because there is no rocket science template in Scratch made yet that we can build the lesson and adapt from.

### B2: Lego Mindstorm by Lego

Some schools have Robotics program such as Lego Mindstorms to allow students to learn the basics of computational thinking with some coding. We did not adopt this because there no rocket science template in Lego made yet that we can build the lesson and adapt from. Moreover, it would be financially burdening for Hillgrove Secondary to purchase them just for this purpose.

### B3: ToonTalk by Ken Kahn

Based on a initial literature search, ToonTalk appears to be a free but requires installation software (school computer lab with SSOE cannot allow student to install) that aims to make programming child’s play. It is a tool suited for animation of story and we are not familiar how to model the physics of rocket science in it. In additional, the need to install the software is heighten the barriers to explore it.

### B4: Why choose Easy Java Simulation by Francisco Esquembre?

#### B4.1 Free and powerful tool

This Easy Java Simulation, EJS, (Esquembre, 2012) tool is free and powerful physics tool from Open Source Physics (Christian, 2012) developed by Francisco Esquembre and Wolfgang Christian, world renowned Mathematician and Physicist respectively. The cost of conducting these lessons is zero dollars, assuming schools already have computer labs for students to code using EJS.

#### B4.2 No installation required

EJS is very easy to set-up as students need only to just unzip the file and run (not installation required). This is critical as all government aided and funded school does not allow ordinary teachers and students to install unauthorised computer program.

#### B4.3 Award winning physics tool with rocket lesson template

EJS is actually designed for making computer models suited for physics education and has a library of 500+ templates to choose from of which the rocket science is already modeled in Larry Engelhardt’s Modeling a Rocket Launch with Gravity and Air Resistance . We are pleased to announce that their work won the Science Prize for Online Resources in Education (Christian, Esquembre, & Barbato, 2011) www.sciencemag.org/site/special/spore/ where we are contributed 10+ computer modeling packages. In additional, we wanted to use tools that real physicists use for greater relevance to students who wishes to pursue a career in field of computational Physics.

#### B4.4 Expertise

Thanks to Larry Engelhardt’s Modeling a Rocket Launch with Gravity and Air Resistance (Figure 1), we adapted it to suit the secondary 3 enrichment programme for Hillgrove Secondary niche area of flight and aerospace. This is quite easy for us since we have being contributing to Open Source Physics since 2006 in our own free time and more formally since 2011 in an MOE-NIE-NRF funded EduLab project NRF2011-EDU001-EL001 Java Simulation Design for Teaching and Learning.

 Figure 1.    Modeling a Rocket Launch with Gravity and Air Resistance written by Larry Engelhardt, licensed GNU General Public License Version 3 license, free access.

## C: Conceptualization:

The seed of opportunity was planted by Ho Peng, DGE who suggested to Kenneth Lee Principal of Hillgrove Secondary to call Loo Kang (Lawrence), Specialist in MOEHQ-ETD to explore gravity-physics-by-inquiry innergy award computer models to strengthen Hillgrove Secondary’s Niche Area in flight and aerospace and was reported in Channel News Asia website http://www.channelnewsasia.com/news/singapore/growing-interest-in/798670.htm (Figure 2)

 Figure 2.    02 Sep 2013 By Amanda Lee on Channel News Asia website http://www.channelnewsasia.com/news/singapore/growing-interest-in/798670.html reports on the “Upper secondary students will learn how to apply physics and mathematical concepts to construct simulations in rocket science” with Education Ministry's Educational Technological Division to further develop flight and aerospace lessons and resources.
After two meetings (Figure 3), it was decided that Loo Kang would conduct an additional special enrichment course to mentor fifteen Secondary three express students on a code to learn journey to allow these students to experience what real engineers and scientists in space program could be doing, modeling science and use the model to predict what if scenario.

 Figure 3. Hand drawn concept (LEFT) by teacher in hillgrove and customization by lookang (RIGHT) of Modeling a Rocket Launch with Gravity and Air Resistance written by Larry Engelhardt, licensed GNU General Public License Version 3 license, free access. http://weelookang.blogspot.sg/2013/08/collaboration-in-flight-and-aerospace.html
The real test is not a multi-choice pre-post test but a more authentic performance task to create rocket computer with air resistance and varying gravity model that is scientifically accurate enough and creatively adapted by the students. Their computer work in progress computer models can be accessed from their respective pages here http://tinyurl.com/hgssrocket

## D: Implementation:

### D1 Design/Plan:

A pilot two hour lesson (Figure 4) was conducted with seven interested in coding teachers in Hillgrove Secondary. This allows the lesson to be co-designed with teachers' input. For example, the teachers’ feedback that the “Event Handler Method” is too complex for Secondary three students and we decided students only need to code in the “Fixed Relations”. We also added more comments lines to guide the students to key in what codes to which place of the authoring toolkit for the model to run. In terms of building teacher capacity, these seven teachers should be able open and customize simple models built on the Open Source Physics.

 Figure 4. Screenshot of blogpost to support teachers in Modeling a Rocket Launch with Gravity and Air Resistance. http://weelookang.blogspot.sg/2013/08/collaboration-in-flight-and-aerospace.html

### D2 Implementation:

#### D2.1 Hands-on Lesson 1:

We used two trainers instead of just one as we wanted to support and facilitate the students each with their own computer models building. This has allowed for more timely support to guide the students in their many questions.

We used a website https://sites.google.com/a/moe.edu.sg/rocketbuilding/ (Figure 5) for students to access and with the instructions and screenshots to support differentiate instruction and pace of the students. The engagement phase we used a case where students role play as real scientist and engineers working on the International Space Station program.

 Figure 5.    Screenshot of https://sites.google.com/a/moe.edu.sg/rocketbuilding/homework to support students in the engagement phase of role playing as real scientist and engineers working on the International Space Station program.
To give the readers a flavour of the lesson, we explain some key stages, similar to “productive failure” of what the students “code to learn” during the hands-on lesson such as to change start with a template where the evolution of the incomplete rocket model starts from a constant upward velocity motion model (Figure 6).

 Figure 6. Screenshot (LEFT) EJSconsole Evolution dy/dt = vy =1 and the corresponding (RIGHT) simulation view of the rocket moving upwards at a constant velocity vy = 1 source code https://sites.google.com/a/moe.edu.sg/rocketbuilding/homework/lesson1/RocketTemplatemodifed.ejs?attredirects=0&d=1

Through progressively testing and failures of their own initial ideas-models they can incrementally getting closer to an appropriate rocket model.
Students could progress from a model on free falling equation of motion (Figure 7).
$\frac{dv_{y}}{dt}= -g$

The students need to declare their variables such as g = 9.81 after looking the error message.

 Figure 7. Screenshot (LEFT) EJSconsole Evolution dv/dt = -g = -9.81 and the corresponding (RIGHT) simulation view of the rocket moving downwards at a increasng rate as predicted by evolution equation.

Progressing through the Newton’s 2nd Law,

$\frac{dv_{y}}{dt}= a = \frac{F}{m}$

students can suggest the F/m, force per unit mass to be model for the case of the rocket exhaust gases creating a thrust. The students were brought through the derivation combining

$F = ma = \frac{dm}{dt}( \int a dt ) =BurnRate*v$

where burnRate is the amount of fuel burnt per sec and v is the velocity of the exhaust gases ejecting downwards from the rocket’s bottom.

So the students code in
$a = \frac{dv_{y}}{dt} = -g + \frac{(burnRate*v)}{(m+mFuel)}$

Here, the students also need to declare the variables introduced such as exhaust gases velocity v = 7000 m/s, Mass of rocket M =10000 kg etc.

Typically, in normal classroom teaching, students would have difficulties appreciating Burnrate because it is a concept that ordinary classroom does not allow for testing through mathematical modeling, whereas in this lesson, students can propose incorrect models can see the outcomes of their incorrect model until they are satisfied with their results simulated by the computer.
The other teaching moment could be the need to divide by mass of rocket and mass of rocket fuel (m+mFuel) which students usually memorize without opportunities for simulated feedback from a computer on their models-equations.
The students were also not able to distinguish 2 similar variables such as velocity of rocket vy and velocity of fuel v, but because these 2 variables are testable through the model, the students were more appreciative of these distinct variables despite its common SI units of metre per second.

 Figure 8. Screenshot (LEFT) EJSconsole Evolution dv/dt = -g +(burnRate*v)/(m+mFuel) and the corresponding (RIGHT) simulation view of the rocket moving upwards at an increasing rate as predicted by evolution equation.

To model air resistance, the students need to add a DragForce model such as

DragForce = 0.5*densityair*area*Cd*vy*vy

where densityair = 1.25 kg/m3, cross sectional area of rocket pushing through air = 10 m2 (given), coefficient of drag Cd = 0.5 (given) and vy is the velocity of the rocket in the y direction.
 Figure 9. Screenshot (LEFT) EJSconsole Evolution dv/dt = -g +(burnRate*v)/(m+mFuel) –DragForce/((m+mFuel); and the corresponding (RIGHT) simulation view of the rocket moving upwards with air resistance with a sudden drop in velocity at t =10 s after the mFuel and BurnRate = 0 with Dragforce and gravity acting downwards to oppose the rocket’s continual upward motion.

 Figure 10. Screenshot (LEFT) EJSconsole Fixed relation where DragForce = 0.5*densityair*area*Cd*vy*vy is modeled and the corresponding (RIGHT) variables page view with the respectively variables declared.

In summary, we introduce the basics of coding in the context of EJS (Easy Java Simulation) by eliciting what the students already know in terms of equations of motion involving acceleration in the y-direction dvy/dt (Figure 6). We bring the students through a process of model improvement or ‘productive failure’ ( adding gravity –g (Figure 7), adding rocket propulsion +BurnRate/(m+mFuel) (Figure 8), and including air drag -DragForce/(m+mFuel) (Figure 9)). We speculate this failure of each model allows for deepening of understanding that playing with simulations or reading traditional books alone cannot provide.

Lastly, to ensure learning occurs on track, we included a working teacher model RocketTemplatewee.ejs (Figure 11) for students to check for coding differences and guiding students who progress at their own paces.

 Figure 11. Screenshot of https://sites.google.com/a/moe.edu.sg/rocketbuilding/homework/lesson1 to support students in the exploring-building phase of role playing as real scientist and engineers working on the International Space Station program. Notice students only need to key in on the Fixed Relations with scaffolding comments lines made by the trainers. A incomplete RocketTemplatemodified.ejs and a teacher model RocketTemplatewee.ejs are provided to guide the students in this hands-on lesson.
We are pleased to report that for 2.5 hours, the students were engaged in the hands-on and no one was seen playing some unrelated computer games.

 Figure 12. Photo by lawrence of students in the exploring-building phase working on implementing their ideas and make sense of the lesson for 2.5 hours of concentrated doing and thinking.

### D2.2 Adaptive Lesson 2:

The next lesson was more personal-mentoring where we wanted to solve the students’ problems in coding so there were less direct instructions and more personal discussions. We also planned out some of the essential activities and tasks for students to do on the website https://sites.google.com/a/moe.edu.sg/rocketbuilding/homework/lesson2. An example of this could be relating how a real rocket should behave when it reaches the ground again. The code required is

if (y  < 0 ) { _pause () ; }
as shown. The students could now see the effects of this new code as previously, the rocket would move below the ground whereas now the simulation pause after hitting the ground surface when y = 0.
 Figure 13.  EJSconsole view of the codes students need to key in or copy and paste from google site or teacher model.  if (y  < 0 ) { _pause () ; }

While in the lesson, there were opportunities where we link the real world context to the computer model so we got students to associate that what they are doing is modeling the real world physics.

For example, we know that this equation predicts the gravitational field strength

$g = G\frac{M_{earth}}{r_{earth}^{2}}$

where G is the universal gravitational constant =6.67384 × 10^-11 m3 kg-1 s^-2and r = 6.37× 10^6 m is the radius of the Earth to that point.

After struggling with some simple ratio

$\frac{g}{g_{surface}} = \frac{G\frac{M_{earth}}{(r_{earth}+y)^{2}}}{G\frac{M_{earth}}{(r_{earth})^{2}}}$

where y is the height of the rocket above the surface at ground level. We arrived at the expression to be used in the model as
$g = \frac{r_{earth}^{2}}{(r_{earth}+y)^{2}}g_{surface}$

So the student need to implement this mathematical equation in the fixed relations (Figure 14) and see what happens for themselves that when y = 5 × 10^6 m, the gravitational field strength is g = 8.43 ms-2 (Figure 15).

 Figure 14. EJSconsole view of what the students need to do in the key in g = gs*Rearth*Rearth/( (y+Rearth)*(y+Rearth) ); into the fixed relations.

 Figure 15. Simulation view of the rocket at the height above ground y = 5 × 106 m , the gravitational field strength is g = 8.43 ms-2 so that they know how the number is changing according to the mathematical model for gravity they constructed by keying g = gs*Rearth*Rearth/( (y+Rearth)*(y+Rearth) ); into the fixed relations.

#### D2.3 End in mind Lesson 3:

The last lesson we got the students to use the teacher model where the physics is correctly modeled and we explain the various physics concepts in the context of a rocket. The students were asked to predict what will happen, observe the teacher model and collectively we illicit explanations from them based on the evidences from the model.

So the trainers are not always correct but rather we all rely on the computer model to situate our discussions and collective agreement.

The students also answered some of the questions asked on the Day 1 with their screen capture their computer screens and share their answers, for example https://sites.google.com/a/moe.edu.sg/rocketbuilding/homework/lesson1/group01
For example, it would be difficult for students to solve word problems on rocket but now through coding, the students were able to answer questions like

“Can this rocket reach the international space station (ISS) at height y = 355 000 m?”

Being able to check the codes and the eventual running of the rocket model (Figure 16) really is key to making sense and deepening learning.

 Figure 16. Simulation view of a student’s model rocket at the height reaching the international space station at the height of 355 km at the time of about 325 seconds where the minimum fuel required is about 8500 kg.

The other question two is

“Using the rocket’s full fuel capacity, what is the maximum payload in kilogram that could reach the ISS?”

After some playing and changing the mass of the rocket to 12500 kg, most students understand payload as additional mass which is 2500 kg (Figure 17) after subtracting the mass of rocket of 10000 kg.

 Figure 17. Simulation view of student’s model of the rocket at the launch hirht y = 0 where student key in M = 12500 kg to test whether the rocket can still reach the international space station at the height of 355 km with the typical fuel of 10000 kg.

## E1: Quantitative Feedback

 Questions \ Likert Scale Strongly Disagree 1 2 3 4 5 Strongly Agree 6 The lesson meet schools’, teachers’ and pupils’ needs 0% 0% 11% 22% 56% 11% I enjoyed learning about physics through this lesson 0% 0% 0% 78% 0 22% this lesson prepare you for life instead of just for examinations 0% 0% 0% 44% 56% 0% SDL1. this lesson allow for 1. Ownership of Learning - self-directed learning? 0% 0% 0% 56% 33% 11% SDL2. This lesson allow for 2. Management and Monitoring of Own Learning - self-directed learning? 0% 0% 0% 22% 56% 22% SDL3. This lesson allow for 3. Extension of Own Learning - self-directed learning? 0% 0% 0% 33% 33% 33% CoL1. This lesson allow for 1. Effective Group Processes - collaborative learning? 0% 0% 0% 11% 44% 44% CoL2. This lesson allow for 2. Individual and Group Accountability of Learning - collaborative learning? 0% 0% 11% 22% 33% 33%

## E2: Qualitative Feedback

Themes emerged for the feedback are as follows:

#### Strengths: Love for learning, Feel like scientists etc

1. This course makes me learn more about physics, learning things outside the classroom. It was interesting and would recommend the others to try out.
2. Questions from students are answered at a fast response. Able to explain terms that we dont understand.
3. Students are exposed to new things at a young age. This also allows students to learn things that are not found easily outside
4. I have learnt more things about physics and this has helped me develop my understanding of physics.
5. I have learnt something outside the classroom which is much more interesting than just learning what's in the textbook. It has made me more interested in physics too.
6. Questions. Make me ask questions.
7. It taught me rocket science :D
8. In these lessons, I learnt about rocket simulation.
9. In these lessons I've attended, it had made me feel like being a scientist, making studies on rocket simulations.

#### Area of improvement: Difficult pedagogy

1. Maybe a longer duration would be better.
2. It is too complicated and difficult to understand.
3. Some equations are a little too complicated. ( the codes )
4. Some parts of the lesson is hard to understand.
5. Students sitting at the back could not see the screen so sometimes do not what to do.
6. Students sitting at the back couldn't really see anything as the computers are blocking.

#### Comments: Thank you teachers, effective lesson etc

1. I have enjoyed the course and I would like to thank the trainers and the teachers for teaching and organizing the course.
2. This is effective as it helps us to understand space better by teaching us the concepts of rockets. However, it is more difficult for us as most of us do not understand coding
3. The teachers have been really helpful in clearing doubts that the students had.
The teacher in charge was very grateful to the trainers for having gone the extra mile in mentoring his students to “learn by coding” as this is an advance pedagogical approach practice by computational physics professors in overseas universities.

## F: Effective:

The quantitative feedback table( N=9) above suggests the lessons have largely being able to meet the schools’, teachers’ and pupils’ needs, (88%) 2) they enjoyed learning about physics through this lesson (100%) 3) they agree these lessons prepare them for life instead of just for examinations (100%).

Elements of self directing learning (100%) and collaborative learning (96%) were also evident during the lessons as we guided students to code their rocket model and allow their work collaboratively after class on the same model.

The qualitative feedback suggests the students appreciated the rationale for having such specialized pedagogy aims to better prepare them for the future despite the difficulties in learning by coding both in software and physics content knowledge mastery.

The teacher-in-charge tried to learn how to conduct lesson on coding but also expressed reservations in doing this same lesson next year as he still need more guidance and experience in conducting such specialized pedagogy – learn by coding.

## G1: Global Scaling up

The lesson is published publicly on https://sites.google.com/a/moe.edu.sg/rocketbuilding/ and anyone is free to scale up in their own schools, licensed creative commons attribution. For example, a teacher in Greece has gotten many ideas on how to conduct his own lessons by looking at the way we conducted our lessons.

 Figure 18.    Fellow teacher Νικόλαος Κυπριωτάκης in Greece thanking us for giving him many ideas on learn by coding.

## G2: Local scaling up

The vice principal of river valley high has expressed interest in these line of lessons –learn by coding rocket science example. In fact, this school has also conducted similar lessons before on the example of frictional sliding block example over 1 academic year for secondary three as a student research project.

The lesson is also published in OPAL ICT connection lesson example for login users and we will be sharing this in various platforms such as Physics Chapter Brown Bag Series, eduLab@AST workshop etc.

### H: Suitability to public

#### H1: Use the learning by coding pedagogy

The lesson is suitable for parents and public with (TPACK) Technological Pedagogical Content Knowledge (Mishra & Koehler, 2006) and the willingness to learn by coding together with their children.

#### H2: Use model-simulation to explain

Parents and public could also use this lesson’s model-simulation to explain a recently launched Singapore’s Nanyang Technological Universityfirst student-built satellite, VELOX-PII, soaring some 600km above Earth. The 1.33kg pico-satellite was designed and built entirely by engineering students from NTU’s Undergraduate Satellite Programme. http://ow.ly/rdDNX

#### H3: Use the mobile app version to explain or/and learning by coding

We have also created a mobile operating system version of the rocket model (Figure 19) view able on most mobile phone browsers here and the editable source code is available here for learning by coding pedagogy.

 Figure 19. Basic Rocket JS Model re made into a JavaScript (JS) Model for running on most mobile device browser. http://weelookang.blogspot.sg/2013/09/basic-rocket-js-model.html Basic Rocket JS Model author: Larry Engelhardt and lookang (this JS model)online: https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_rockettemplatelookang04/rockettemplatelookang04_Simulation.html offline: https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_model_rockettemplatelookang04.zip source code: https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejss_src_rockettemplatelookang04.zip

## Reference:

1. Christian, Wolfgang. (2012). Building a National Digital Library for Computational Physics Education Podcast. from http://vimeo.com/37964196
2. Christian, Wolfgang, & Esquembre, Francisco. (2007). Modeling Physics with Easy Java Simulations. Physics Teacher, 45(8), 475-480.
3. Christian, Wolfgang, Esquembre, Francisco, & Barbato, Lyle. (2011). Open Source Physics. Science, 334(6059), 1077-1078. doi: 10.1126/science.1196984
4. Esquembre, Francisco. (2012). Easy Java Simulations. Retrieved 13 September, 2012, from http://www.um.es/fem/EjsWiki/pmwiki.php
5. A Framework for K-12 Science Education: Practices, Crosscutting Concepts, and Core Ideas. (2012). Washington, DC: The National Academies Press.
6. Mishra, Punya, & Koehler, Matthew J. (2006). Technological Pedagogical Content Knowledge: A Framework for Teacher Knowledge. Teachers College Record, 108(6), 1017-1054.
7. MOE. (2012). Opening Address by Mr Hawazi Daipi, Senior Parliamentary Secretary Ministry of Education and Ministry of Manpower, at the International Conference on Teaching and Learning with Technology (iCTLT) at the Suntec International Convention and Exhibition Centre, on Thursday, 29 March 2012. Retrieved 29 March, 2012, from http://www.moe.gov.sg/media/speeches/2012/03/29/opening-address-by-mr-hawazi-daipi-at-ictlt.php
8. Wee, Loo Kang, & Mak, Wai Keong. (2009, 02 June). Leveraging on Easy Java Simulation tool and open source computer simulation library to create interactive digital media for mass customization of high school physics curriculum. Paper presented at the 3rd Redesigning Pedagogy International Conference, Singapore.

## Friday, November 22, 2013

### How to Sign Jar Files for Web Deployment of Java Applets, an Easy Java Simulation applet example.

How to Sign Jar Files for Web Deployment of Java Applets, an Easy Java Simulation applet example.
this tutorial serves to allow you to sign your own EJS applets.

1. install latest JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html. For example, Windows x86 for Windows  XP operating system
2. after installation, there should be C:\Program Files\Java\jdk1.7.0_45\bin where the keytool.exe is located.
3. in order to run the cmd line keytool, add the PATH to include C:\Program Files\Java\jdk1.7.0_45\bin by going to Start , Settings, Control Panel
4. Navigate to System, Environment Variables, Path Edit and add ;C:\Program Files\Java\jdk1.7.0_45\bin to the Variable value, so that the cmd line keytool avoid the error 'keytool' is not recognized as an internal or external command, operable program or batch file.
5. Now, you are ready to go and type some lines by Naviagting to Start, Run
6. type in cmd and press enter in the keyboard
 cmd
7. this will bring up a C:\WINDOWS\system32\cmd.exe console
8. in order to save yourself some heavy typing, use the windows explorer to navigate to the folder where you saved all your jar files that you want signed. For example copy F:\Dropbox\Public\lookangEJSworkspace\export
9.  go to  C:\WINDOWS\system32\cmd.exe console and do a right click and paste after you type cd  F:\Dropbox\Public\lookangEJSworkspace\export
10. to get cd  F:\Dropbox\Public\lookangEJSworkspace\export and you need to type f: if you are using a different drive like me
 cd F:\Dropbox\Public\lookangEJSworkspace\export f:
11. type keytool -genkey -keystore myKeystore -alias myAlias -validity 1800 , for my example my Alias is lookang, i recommend to keep myKeystore as it is and adding -validity 1800 for a 1800 days of certification instead of the default 6 months. i used keytool -genkey -keystore myKeystore -alias lookang -validity 1800
 keytool -genkey -keystore myKeystore -alias lookang -validity 1800
12. enter your own password, don't tell anyone this password and follow the instruction the best you see fit
13. notice that a new file called myKeystore is generated in the folder F:\Dropbox\Public\lookangEJSworkspace\export
14. u are now ready to sign all jar applets using that just created myKeystore. type or copy this jarsigner -keystore myKeystore myJar.jar myAlias but for my case i will type jarsigner -keystore myKeystore ejs_model_RocketTemplatewee.jar lookang . you need to replace myJar.jar with the name of the own *.jar files and the myAlias also need to replace to the myAlias you used, for my case lookang. When ask for the Passphrase, just key in your password you used in step 12.
 jarsigner -keystore myKeystore ejs_model_RocketTemplatewee.jar lookang
15. now, how do i create a *.bat to run all this command for my 100+ applets? leave a Google+ comment at the bottom of this post and tell how :) Enjoy!

Reference:


text:
# Can a non-deterministic finite automaton die out before reading the entire string?

I am new to automata theory and have a problem that I want to solve. We have to design an NFA that starts with "ab". I have the solution and it is given by:

However, my problem is: If the string does not start with $$a$$ then the machine will die out in such a case and will not read other letters in the given string, is this fine? I have read somewhere that the machine should not die out till the string is completely read (even if the string is not accepted), and such is not the case here.

Furthermore, if this is not the case then, why should the state $$q_2$$ needs to have an arrow over itself? Do I really need to care? Once the string is having an "$$ab$$" in the beginning, the machine knows it has to accept the input and can die out.

I am just confused, the given NFA confers that the machine can die out even without reading the whole string, Is this fine? And If it is and why to put a self-arrow over $$q_2$$?

Formally the transition function $$\delta$$ of a NFAs is a total function with domain $$Q \times \Sigma$$ and codomain $$\mathcal{P}(Q)$$, where $$Q$$ is the set of states and $$\Sigma$$ is your alphabet and $$\mathcal{P}(Q)$$ is the power set of $$Q$$.

The NFA accepts a string $$s=s_1s_2s_3 \dots$$ iff there is a sequence of states $$q_0,q_1, \dots, q_n$$ where $$q_0$$ is the initial state of the NFA and, for $$i=1,\dots,n$$, $$q_i = \delta(q_{i-1}, s_i)$$.

As a consequence, if there is no possible sequence of states that satisfies the above condition (what you seem to call "die out"), the NFA rejects.

A way to check whether an accepting sequence of states exists is that of keeping track of a set $$S$$ of states while simulating the NFA on the input string. Initially $$S = \{q_0\}$$, where $$q_0$$ is the initial state. Then, for each character $$s_i$$ of $$s$$, in order, update $$S$$ to $$\bigcup_{q \in S} \delta(q, s_i)$$. At the end of this process, accept if and only if $$S$$ contains a final state.

This shows that if $$S$$ becomes empty at any point during this process, then it will remain empty and the input string will be rejected.

Regarding your second question, 'Design an NFA that starts with "ab"', doesn't mean much. Maybe you wanted to design a NFA that recognizes all strings that start with "ab", i.e., those described by the regular expression $$ab(a\mid b)^*$$. If that's the case then if you were to remove the self-loop from $$q_2$$ you wouldn't be accepting all the needed strings. For example "abb" would be rejected.

• Precisely, this means that for an NFA dying out of a machine before it can read the entire string is equivalent to that string being rejected by the machine. So, for an NFA the rejection happens when we are in a state that is not the final state or the machine has died out before reading the complete string. Am I correct? Aug 18 '21 at 11:59
• I'm sorry I don't know what "dying out of a machine" means in the context of NFAs. A NFA rejects if there is no accepting path corresponding to the input string from the initial state to one of the final states. Aug 18 '21 at 12:51
• This answer mixes up DFAs and NFAs. Please clarify. The question is about NFAs. Aug 18 '21 at 14:02
• @reinierpost. You are right. Sorry about that. I have reworked my answer. Aug 18 '21 at 14:22
• @Steven: great, thanks! Aug 18 '21 at 14:51

Formally speaking, an NFA or DFA never “dies out”: for every state $$q$$ and for every character $$a$$ in the input alphabet, there is a state $$q'$$ such that there is a transition $$q \xrightarrow{a} q'$$. The state $$q'$$ is $$\delta(q, a)$$ where $$\delta$$ is the transition function in the definition of the automaton. The automaton only stops when it reaches the end of the input.

There is a very common convention when drawing automata to omit one hidden “dead” state $$q_\dagger$$ which is not accepting. Any missing transition in the drawing is a transition to $$q_\dagger$$, including transitions from $$q_\dagger$$ itself. If the automaton enters this state, it remains in this state. Nothing interesting happens once $$q_\dagger$$ is reached and we know that the input won't be accepted as soon as it's reached, so it's a dead state (More generally, any state from which it is impossible to reach an accepting state is called a dead state. Merging all the dead states into one doesn't change what language the automaton accepts, so it's common to speak of “the” dead state even though there could be many and some automata don't have one. If an automaton doesn't have a dead state, you can add one without changing the language; that state will be unreachable.)

So, for example, the automaton you drew has 4 states $$\{q_0, q_1, q_2, q_\dagger\}$$, and has 4 transitions that are not drawn: $$q_0 \xrightarrow{b} q_\dagger$$, $$q_1 \xrightarrow{a} q_\dagger$$, $$q_\dagger \xrightarrow{b} q_\dagger$$ and $$q_\dagger \xrightarrow{a} q_\dagger$$.

Hiding the implicit dead state simplifies the drawing. Making the dead state implicit, rather than defining the transition function as a partial function, simplifies reasoning about automata. It would be possible to define (non)deterministic finite automata with a partial transition function (DFAWAPTF/NFAWAPTF), and their theory would be basically identical to the theory of DFA/NFA, but reasoning would be more complicated since you'd have to have separate cases for $$(q,a)$$ pairs with a transition and $$(q,a)$$ pairs without a transition. Since every DFAWAPTF has a matching DFA and NFAWAPTF has a matching NFA, there is no point in reasoning about the WAPTF variants.

The state $$q_2$$ does need transitions to itself. If these transitions were not present, then an input such as $$aba$$ would lead to the sequence of transitions $$q_0 \xrightarrow{a} q_1 \xrightarrow{b} q_2 \xrightarrow{a} q_\dagger$$, so $$aba$$ would not be accepted. Without the transitions from $$q_2$$, the automaton would only accept the exact string $$ab$$, and not any other string starting with $$ab$$.

• For NFAs we do not need to use the additional state $q_\dagger$ since the codomain of the transition function $\mathcal{P}(Q)$, where $Q$ is the sets of the states of the NFA. If there is no drawn transition from state $q$ with character $a$, this just means that $\delta(q,a)=\emptyset$. Aug 18 '21 at 17:33


text:
# Category:Indiscrete Topology

This category contains results about Indiscrete Topology.

Let $S \ne \O$ be a set.

Let $\tau = \set {S, \O}$.

Then $\tau$ is called the indiscrete topology on $S$.

## Subcategories

This category has the following 2 subcategories, out of 2 total.

## Pages in category "Indiscrete Topology"

The following 40 pages are in this category, out of 40 total.


text:
1. ## Evaluating an Integral

Assuming ∫ = the integral from (0-3)

I am having trouble deciding what to sub in as u in this integration problem:

∫ x(sqrt(x+1)) dx

Thanks.

2. ## Re: Evaluating an Integral

Let $u = x+1$, $du = dx$

The integral can then be rewritten as:

$\int_{0}^{3} (u-1)(\sqrt{u})du$

I'm sure you can take it from here.

3. ## Re: Evaluating an Integral

Originally Posted by Walshy
Assuming ∫ = the integral from (0-3)

I am having trouble deciding what to sub in as u in this integration problem:

∫ x(sqrt(x+1)) dx

The integral $\int_0^3 {x\sqrt {x + 1} dx}$ becomes $\int_1^4 {(u - 1)\sqrt u du}$.

Do you see how?

4. ## Re: Evaluating an Integral

Yes, I see. Thanks for the help guys.

5. ## Re: Evaluating an Integral

Let $u = x+1$, $du = dx$

The integral can then be rewritten as:

$\color{red}\int_{0}^{3} (u-1)(\sqrt{u})du$
The limits of integration are not correct.

6. ## Re: Evaluating an Integral

Given this, I should clarify that my bounds were regards to X, so when you integrate, you should back substitute U so you are in respect to X before evaluation of the bounds.

You can change the bounds so that they are with respect to U and integrate.

Or, you can leave the bounds with regard to X, integrate with respect to U and then back substitute so that you end up with the original function (f(x), not not f'(x)) with respect to X.

Same result.