text:
All posts

# Getting Started With High-Level Tensorflow

TensorFlow is one of the main tools used in the industry to perform Machine Learning (ML), either using it at a low-level for graph computation, or at a high-level to create models using pre-defined building-blocks. The latter is the most common approach when learning to build and train ML models.

## Motivation

In this article I’ll explain how to use TensorFlow at a High-level in order to build a model that is capable of identifying the sentiment of a comment as either positive or negative. The article will be driven by the following questions: what?, why?, and how?

I just described the first one: what we are building is a model that can predict the sentiment of a comment. Now, why would this be useful? Well, as an example, let’s say you want to know how your brand is performing on social networks. Are customers happy about you? In order to answer that question you may hire a Community Manager to analyze hundreds/thousands of comments to give you an answer. That would be both time consuming and expensive, moreover, if you perform such tasks periodically, then you should think of a better strategy to handle this. A possible strategy could be to create a ML model that can handle that task for you, saving you a lot of time and money. Having answered the what and why, let’s use the rest of the article to explain the how.

## A (Very) Summarized Representation of a ML Experiment

In order to get some background on what we are going to do, I created this diagram that explains what’s the common protocol to follow when performing a Machine Learning experiment. It’s just a very (very) general idea and each step involves a lot more work, so this is an oversimplification.

## Requirements

• An environment with TensorFlow installed. I’ll use Google Colab so I suggest you to do the same so you don’t have to install or set up anything.
• The code will be based on the official TensorFlow documentation, with several modifications.

Go to Google Colab and create a new notebook. Then, put this starting code in the first cell:

!pip install -q kaggle pyyaml

import matplotlib.pyplot as plt
import TensorFlow as tf
from TensorFlow import keras
from TensorFlow.keras import layers
from collections import Counter
import numpy as np
import seaborn as sns

class Utils:
# A dictionary mapping words to an integer index
INDEX = imdb.get_word_index()
INDEX = {k:(v+3) for k,v in INDEX.items()} # The first indices are reserved
INDEX["<START>"]  = 1
INDEX["<UNK>"]    = 2  # unknown
INDEX["<UNUSED>"] = 3

REVERSE_INDEX = dict([(value, key) for (key, value) in INDEX.items()])

@classmethod
def decode_review(cls, text):
return ' '.join([cls.REVERSE_INDEX.get(i, '?') for i in text])

@classmethod
def plot(cls, history=None, series=None, title=None):
PARAMS = dict()
PARAMS['acc'] = dict(label="Training Acc", )
PARAMS['val_acc'] = dict(label="Validation Acc", )
PARAMS['loss'] = dict(label="Training Loss", )
PARAMS['val_loss'] = dict(label="Validation Loss", )

epochs = range(1, len(history[series[0]]) + 1)

for serie in series:
plt.plot(epochs, history[serie], **PARAMS[serie])
print(f"Max {serie}: {max(history[serie])}")

plt.title(title)
plt.xlabel('Epochs')
plt.legend()

plt.show()

NUM_WORDS = 10000

## Gather Data

We collect samples to train the model. We’re performing “supervised classification” so data should be “labeled”. Labeled data contains examples with a priori predictions of what we want to learn, meaning that we will have samples of comments along with their related labels (positive or negative). It could be seen as: “I have these comments, this one is positive, this other is negative, this one seems to be also negative, …

Quite often, labeling data is performed manually and it consumes a lot of time. If we’d have to do it, we would need to read each comment and determine if it’s positive or negative. Fortunately, we already have a labeled dataset to work with. It’s going to be the IMDB dataset and we can load it from TensorFlow datasets:

imdb = keras.datasets.imdb
(train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000)
print("Training entries: {}, labels: {}".format(len(train_data), len(train_labels)))

Output

Training entries: 25000, labels: 25000

FYI: There are even businesses built around the data labeling task, they can label huge amounts of data for you, but of course you have to pay for it.

The dataset contains 50,000 reviews of movies. 25,000 are positive comments and 25,000 are negative.

## Data Preprocessing

Data often needs to be cleaned and transformed into special data structures. For example, when working with text, you usually need to remove special characters, transform it to lowercase, remove punctuation and stop words (i.e. the, a, an, to, for…), normalize sentences (verb reduction), and more. The current dataset already has pre-processed the data in a certain way:

(…) each review is encoded as a sequence of word indexes (integers). For convenience, words are indexed by overall frequency in the dataset, so that for instance the integer “3” encodes the 3rd most frequent word in the data. This allows for quick filtering operations such as: “only consider the top 10,000 most common words, but eliminate the top 20 most common words”. – Keras Docs

And this is how a sample looks:

array([list([1, 14, 22, 16, ...]),
list([1, 194, 1153, 194, ...]),
...,
list([1, 11, 6, 230, ...]),
list([1, 1446, 7079, 69, ...])],
dtype=object)

As mentioned above, each number represents a word ranked by its frequency i.e. 4 means the most common word (1-3 are reserved numbers). TensorFlow documentation already includes an example to convert such a data structure to the text original form. Let’s use it to see a data example:

Utils.decode_review(train_data[0])

Output:

"<START> this film was just brilliant (...) after all that was shared with us all"

Because each record has different amounts of words, the current data we have is not homogeneous so we cannot use it to feed the model directly. Therefore, we need to transform the data into a homogeneous set. In this example, we are going to pad the records to a fixed length. TensorFlow already has some utilities to do that. Let’s see how it works:

train_data = keras.preprocessing.sequence.pad_sequences(train_data,
maxlen=256)
maxlen=256))
for i in range(4): print(f"Length of record {i + 1}: {len(train_data[i])}")
print(train_data[:4])

Output:

Length of record 1: 256
Length of record 2: 256
Length of record 3: 256
Length of record 4: 256
[[   1   14   22 ...    0    0    0]
[   1  194 1153 ...    0    0    0]
[   1   14   47 ...    0    0    0]
[1784   86 1117 ...   21   64 2574]]

As you can see, there are records that are zero padded to the right (the value we specified in value=Utils.PAD_VALUE). Now that we have a homogeneous dataset, we can continue to build and train the model.

## Building and Training a Model

There are many Machine Learning algorithms that create learning models. We are going to use a classification model, which you can interpret as a function that receives an input and returns a label as its output. TensorFlow focuses on a very specific kind of model from the neural networks family.

We feed a model with both the training data and the labels (a priori knowledge of the predictions). The model “reads” the records and internally learns what makes that record to be assigned to a specific label (i.e. positive or negative). When we feed it with enough data, its accuracy often improves.

Below is an image of how a Deep Neural Network (DNN) looks like.

In the context of a DNN you have three sections: first, the input layer, second, a couple of hidden layers, and third, an output layer. The common purpose is that, given an input, return as output which label it belongs to with a certain probability.

Each hidden layer has a certain amount of hidden units and an activation function. Each hidden unit holds a weight which commonly is a float value in the range [0, 1].

When you train a model, you feed it with an input at the first layer, then, it flows through the network and, as it passes through the hidden units, each unit gets activated **(or not) depending on its weight value. The input flows until it reaches the output layer and, once there, a float number for each possible label (two: negative or positive) is returned. That number is the probability that such input belongs to the respective label. Such a result is compared with the real label (which we know a priori, the train_labels value we’re passing) and depending on how right or wrong it is from the real value, the network updates the weights of all the hidden units in order to reduce that error.

The previous process is repeated by a predefined number of epochs. Each epoch may improve the model accuracy, so the more epochs we train it, the better results we may get (until we overfit, which we’ll explain later in this article).

I hope that explanation should serve to understand the following code.

First, let’s define the architecture of the neural network.

cb_save = tf.keras.callbacks.ModelCheckpoint("imdb_model/checkpoints.ckpt",
save_weights_only=True,
mode='max',
monitor='val_acc',
save_best_only=True,
verbose=1)
model = keras.Sequential([
keras.layers.Embedding(NUM_WORDS, 16),
keras.layers.Dropout(0.5),
keras.layers.GlobalAveragePooling1D(),
keras.layers.Dropout(0.5),
keras.layers.Dense(16, activation=tf.nn.relu,
kernel_regularizer=keras.regularizers.l2(0.01)),
keras.layers.Dropout(0.5),
keras.layers.Dense(1, activation=tf.nn.sigmoid)
])

model.summary()

The model architecture consists in the following:

• First, an Embedding layer. It takes the input words as integers and looks up for something called embedding vectors. It’s quite a more advanced kind of layer but you can read more information here.
• A Dropout layer. It randomly “deactivates” some of the hidden units in order to avoid overfitting. The parameter it receives 0.5 is the fraction of the units to drop.
• A GlobalAveragePooling1D layer. It “simplifies” the input by averaging the values into a fixed length.
• Again, a Dropout layer.
• A Dense layer. It is a layer that contains several hidden units, very similar to the ones shown in the above images labeled as hidden layers.
• The first parameter, 16, indicates the number of hidden units. Then, you must specify an activation function (activation=tf.nn.relu). The most common is relu but there are few more like tanh, sigmoid, softmax… Depending on the one you choose, you can get better results.
• The kernel_regularizer parameters help to reduce overfitting.
• One more Dropout layer.
• The output layer. A Dense layer with just one hidden unit.

Once you run the above code, it will print the model’s summary:

_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
embedding_24 (Embedding)     (None, None, 16)          160000
_________________________________________________________________
dropout_31 (Dropout)         (None, None, 16)          0
_________________________________________________________________
global_average_pooling1d_24  (None, 16)                0
_________________________________________________________________
dropout_32 (Dropout)         (None, 16)                0
_________________________________________________________________
dense_63 (Dense)             (None, 16)                272
_________________________________________________________________
dropout_33 (Dropout)         (None, 16)                0
_________________________________________________________________
dense_64 (Dense)             (None, 1)                 17
=================================================================
Total params: 160,289
Trainable params: 160,289
Non-trainable params: 0
_________________________________________________________________

Now, we have to compile the model; you can see it as a commit action. The most remarkable parameter here is the optimizer. We’re choosing the Adam optimizer but there are more like RMSProp, AdaGrad, AdaDelta, and SGD. It’s a very important parameter, depending on the optimizer the model could be quite good or the opposite. In the literature, Adam has shown very good results but when performing an experiment you should try with more optimizers.

To start the training (fit) you have to specify at least the first three parameters:

• train_data: the samples you have that will feed the model.
• train_labels: the real labels you have that correspond to each record in train_data.
• epochs: how many iterations the model will try to “learn better”.
• batch_size: with how many records at a time to feed the model.
• validation_split: during training, we’ll “test” how the model is performing with unseen data. A 30% of the training data will be dedicated to do such test.
• callbacks: we’re specifying one callback, that function (cb_save) will save the status of the model with the best result so far. It’ll be located at imdb_model/checkpoints.ckpt. This is the file we can reuse to deploy our model.
model.compile(optimizer=tf.train.AdamOptimizer(),
loss='binary_crossentropy',
metrics=['accuracy'])

history = model.fit(train_data, train_labels,
epochs=30,
batch_size=512,
validation_split=0.3,
callbacks=[cb_save])

Once you run the code, the model should start training. You will see something like this:

Train on 17500 samples, validate on 7500 samples
Epoch 1/30
16896/17500 [===========================>..] - ETA: 0s - loss: 0.8269 - acc: 0.5013
Epoch 00001: val_acc improved from -inf to 0.50880, saving model to imdb_model/checkpoints.ckpt
17500/17500 [==============================] - 4s 228us/step - loss: 0.8264 - acc: 0.5023 - val_loss: 0.8086 - val_acc: 0.5088
...
Epoch 50/50
16896/17500 [===========================>..] - ETA: 0s - loss: 0.2871 - acc: 0.9197
Epoch 00050: val_acc did not improve from 0.89093
17500/17500 [==============================] - 1s 29us/step - loss: 0.2869 - acc: 0.9193 - val_loss: 0.3204 - val_acc: 0.8899

Every epoch, performance metrics are computed and reported: “loss: 0.8269 - acc: 0.5013 …”. You can also see that the checkpoint callback is working because there will be messages like:

Epoch 00030: val_acc improved from 0.87240 to 0.87280, saving model to imdb_model/chec

It detected when the model improved and saved it.

Once it finished training you will see the final performance metrics:

loss: 0.2869 - acc: 0.9193 - val_loss: 0.3204 - val_acc: 0.8899

Although it says acc: 0.9193, if we look at the val_acc: 0.8899 we can notice that the second one is lower. That’s a sign of overfitting.

### The Overfitting Problem

Overfitting means that the model just memorized the data and not generalized the learning quite well. That means that, if we feed the model again with the original data, then it will most likely predict quite well. However, if we test it with new (unseen) data, it’s very likely to perform poorly. Overfitting is more present on robust networks with a lot of hidden layers and units.

Let’s plot the accuracy and validation accuracy of the model.

Utils.plot(history.history, series=['acc', 'val_acc'], title="Training and Validation Acc")

Output:

Max acc: 0.9193142858505249
Max val_acc: 0.8909333334922791

If you think about it, with a good model both the training and validation accuracy should be going upwards in the plot. In fact, that was the case until epoch ~25. From there on, the training accuracy got better but the validation was decaying. That’s overfitting. The model was just “memorizing” the input data and it was not performing well with unseen records.

Coming back to our code, despite the fact we added Dropout layers and applied regularization, overfitting stills happened. Nevertheless, we reduced it a little bit. I invite you to remove the Dropout layers and the regularization to see the result.

What Should We Do? We could keep the model’s state at epoch 27, which accordingly to the checkpoint callback (and the above plot), it was the one when it performed best. (See why such a callback is so useful?)

We’re not done yet, though. We used validation data to see how it was performing and to keep the best state. Now, it’s time to evaluate the model with many more unseen records.

## Evaluating the Model

It is common to split our data into two (or three) sets, one for training and the other for testing. Remember the test_data and test_labels variables? well, that’s what we did.

We’re going to use the model we have built to test it with those data. The model will receive the records inside test_data and predict labels for each of them, then, those predictions are compared against the real ones (test_labels) and thus, an accuracy can be computed.

There are a lot of metrics you can use, for the moment we’ll use accuracy, although it’s recommended using something like the ROC AUC.

Because it’s a common process, the API already has a method to perform such task:

results = model.evaluate(test_data, test_labels)
print(f"Accuracy: {results[1]}")

25000/25000 [==============================] - 2s 81us/step
Accuracy: 0.88228

We have just compared 25,000 predictions against 25,000 real labels and the accuracy we got is 88.22%

And with that, we’re done 🙂 We have a ML model that can predict if an English comment is positive or negative with 88.22% of accuracy!

## Final Thoughts

I hope I explained the general idea around each step of the experiment. As you can see, there are a lot of new concepts to master. If you are interested, I would like to suggest digging deeper into the types of Neural Networks (e.g. LSTMs or RNNs). Depending on your use case, some architectures are more suitable than others.

Another important aspect are the optimizers. We have just used Adam, but there are others that could perform better in specific architectures. My suggestion is to start learning about stochastic gradient descent (SGD) and then move forward with new ones because many of them are based on the same concept of gradients.

We just made an experiment with one configuration, but in real life you will have to test with more optimizers, architectures and perform hyper-parameter optimization (changing the parameters to find the best ones). You should be aware that this process takes a lot of time.

I created a live notebook where you can see all the code working in this article. You can see it from this link.


text:
## anonymous 4 years ago 81^-3/4 , how do i solve this?

1. anonymous

Make the expression into a fraction. $81^{-3/4} =\frac{ 1 }{ 81^{3/4} }$

Find more explanations on OpenStudy

format: plain


text:
## Is it reasonable to think that most magic users would be familiar with the spell Silence and thus know easy ways to counter it? [closed]

The spell Silence as described in the PHB:

For the Duration, no sound can be created within or pass through a 20-foot-radius Sphere centered on a point you choose within range. Any creature or object entirely inside the Sphere is immune to thunder damage, and creatures are Deafened while entirely inside it. Casting a Spell that includes a verbal component is impossible there.

The spell is obviously a useful tool against magic wielders, but I’m trying to get clarification on its limitations.

Would it be common for magic users to recognize the Silence spell and know easy ways to counter its effects? For example, a wizard familiar with the spell might know to just run a short distance in any direction to leave its area of effect, and then continue casting spells. I understand that different types of characters will have different knowledge of spells, but Silence isn’t a high level spell and would seemingly be well known to many mid- and even low-level magic users.

The related question below might shed light on how a character would react to the Silence spell, because they might instead interpret the effect as being deafened.

Related questions:

Deafness vs Silence – How to distinguish Darkness from being blinded and Silence from being deafened?

## Freelancing Motivation & Technology based Blog | Reasonable Price

Why are you selling this site?
Honestly speaking, I design this site for myself to earn some extra income via google adsense. I posted paid and self-written articles on this site and applied for adsense but the site gets rejected. I am no more interested in doing work on this.

How is it monetized?
It's not monetized but you can monetize it via google Adsense using paid service of any expert. I tried but failed. This is one reason to sell this site.

Does this site come with…

Freelancing Motivation & Technology based Blog | Reasonable Price

## what are reasonable age expections for levels?

This is not a question about enforced limits but about plausible NPC reactions, to the PCs and how they explain other NPCs to the players. (Minimums more than maximums, since all a character has to do to stay lower level is not adventure.)

If an NPC can gauge a human sorcerer’s level, and meets one that is 25, and the expectation is that most start adventures at 18 and go up a level generally once a year:

• a second level one spent most time doing things other than adventure
• a fifth level one spent a fair amount of time doing other things, or had many encounters with little experience
• a seventh level one has adventured steadily
• a tenth level one has hit some amazing adventures with much danger and experience
• a fifteenth level one has had nothing but amazing adventures (or is a fraud, or the apparent age is a factor of illusion or de-aging magic)
• a twentieth level one is certainly a fraud or using magic to de-age or appear younger

These can be widely off, of course, with the second level one having been the victim of aging magic or the twentieth level one having had to start adventuring young and had some amazing adventures, but they are accurate enough that NPCs would not find such assumptions — an inn keeper saying that the sorceress staying at the inn isn’t the real adventuring type, or a high-level wizard commenting that another wizard has certainly gotten far for his age — blowing up in their faces often enough to discourage estimates.

Is a year a plausible? Six months? Two years? Or would variation be too much for NPCs to form expectations?

The setting is one that does not require training to go up in level, and in which there are plentiful known dungeons where adventures can be had and with routine supplies near enough to not require travel. Unusual supplies or moving to a new dungeons takes weeks at most, usually days. So, characters who want to can adventure with minimal down-time.

## Is it reasonable to let Inquisitive Rogues get advantage on Perception and Investigation outside combat?

I am DM in a campaign and recently my players reached level 3. The Rogue chose to take the Inquisitive archetype.

I am looking at the Eye for Detail feature, which allows the rogue to make a Perception check to look for hidden things or an Investigation check to uncover or decipher clues as a bonus action. At first glance I interpret this as an extension of the Cunning Action feature (similar to the Thief’s Fast Hands or Mastermind’s Master of Tactics), by giving the rogue more things to do with their bonus action.

The Eye for Detail feature definitely has uses in combat. Bonus action Perception checks are an excellent counter against foes which like to hide (which my players face semi-regularly). Investigation is more situational, but not useless.

However, outside combat the action economy is not so important. If you are acting on the timescale of minutes rather than seconds it is not practical to track individual actions. But on the same timescale of minutes (rather than hours) you can, in principle, track things by individual actions.

By this reasoning, an Inquisitive Rogue can make twice as many Perception or Investigation checks in a given time-frame as any other character (assuming that is the only activity they are doing, and that the checks fall under the specifications for the Eye for Detail feature). They are able to search faster so, given a fixed time-frame, can search more thoroughly, or search a wider area.

Of course, I don’t actually want to track actions round by round for a search which would take a few minutes. That would involve a stupid amount of die rolling and completely skews the statistics. But I was wondering whether the Inquisitive’s Eye for Detail should still provide some benefit.

Would it be reasonable, under appropriate circumstances, to grant an Inquisitive Rogue advantage on Perception and Investigation checks outside combat? Or would this be unbalanced?

‘Appropriate circumstances’ being cases where simply searching more would plausibly improve chances of success (e.g. hide and seek), the timescale of the activity is short enough to make an intensive effort practical (but long enough to not be measured in rounds), the check pertains to the activities described in Eye for Detail, and the rogue is not dividing their attention between other actions.

My rationale behind this is that, in combat, a rogue can roll twice as many checks as someone else, so rolling advantage is essentially equivalent to that. I figure that a small circumstantial non-combat buff which emphasises the archetype’s strengths is acceptable.

My concern is that this might be too advantageous. This greatly extends the usefulness of the feature by allowing it to be useful outside combat, and advantage is a large bonus. If this makes the archetype far more powerful than it should be, or has unintended interactions, then I should be wary about granting such regular advantage. I have not had much experience with Inquisitive Rogues; if they are a powerful archetype then such a buff would be unneeded, although if they are a weak archetype then this buff might be beneficial.

Note that I am not planning to explicitly modify the Eye for Detail feature. Rather, I will use my latitude as DM to grant advantage based solely on the implied usefulness of the Eye for Detail feature. But I wish to discern whether such a ruling is wise or unbalanced before setting a precedent.

## Help in understanding ‘reasonable’ encoding of inputs

I read that a reasonable encoding of inputs is one where the length of the encoding is no more than a polynomial of the ‘natural representation’ of the input. For instance, binary encodings are reasonable, but unary encodings are not.

But say that the input is a graph, and its natural representation is a vertex and edge list. Suppose that the graph has $$k$$ vertices. If I use unary to encode, the overall length of the input referring to the vertex list would be $$O(k^2)$$, i.e. $$=|1^1|+|1^2|+|1^3|+…+|1^k|$$. Isn’t this unary encoding still a polynomial with respect to the number of vertices of the graph (which is $$k$$)?

What am I missing here?

## What is a reasonable player cost for Manor rebuilding?

At some point during the introductory adventure Lost Mine of Phandelver, the PC’s are capable of liberating a manor.

My question is, what is a proper price to charge the party as a cost to rebuild that particular Manor which has largely been abandoned and uncared for save for the basement level? Should I worry about upkeep? Tax? I can not find much in the way of how to go about this in the DMG.

## How to modify a monster to be a reasonable challenge for a level 1 party?

I was preparing a one-shot adventure for my friends. It will include a fight with a weakened mind flayer and a giant heart which will be the boss of the adventure. The heart will summon gory minions (could be anything, must be suited to the gory theme).

How do I modify the mindflayer to be a reasonable challenge for a level 1 party and what official monster is the closest to a giant pulsing hearth (mabe gibbering mouther?) might still be workable. The party will include four first level player characters consisting of the folk hero fighter, cleric, wizard and a rouge from starter set character sheets. Thanks 🙂

## When is a reasonable level range to offer Gurt’s Greataxe to a player?

As suggested in the title, I ran into Gurt’s Greataxe. I was looking up magic items in my free time since I was curious, and I thought why not search for magic items related to greataxes, since my character is a Half-Orc barbarian who is currently a barb-fighter 4-2. I accidentally ran into Gurt’s Greataxe while searching, which is offered in the Storm King’s Thunder campaign that I’m in with my group. For further information, Gurt’s Greataxe gives:

You gain a +1 bonus to attack and damage rolls made with this magic weapon. It is sized for a giant, weighs 325 pounds, and deals 3d12 slashing damage on a hit, plus an extra 2d12 slashing damage if the target is human.

The axe sheds light as a torch when the temperature around it drops below 0 degrees Fahrenheit. The light can’t be shut off in these conditions.

As an action, you can cast a version of the Heat Metal spell (save DC 13) that deals cold damage instead of fire damage. Once this power is used, it can’t be used again until the next dawn.

Heavy. Small creatures have disadvantage on attack rolls with heavy weapons. A heavy weapon’s size and bulk make it too large for a Small creature to use effectively.

Two-Handed. This weapon requires two hands to use. This property is relevant only when you attack with the weapon, not when you simply hold it.

Based off of this rather immense power that the axe has between the 3d12 slashing damage, the extra 2d12 if attacking a human, and the cold version of the Heat Metal spell, although subjective to the DM, what is a reasonable level range that this weapon could be offered in? Because with this weapon, I’d say there’s a point where it would be rather overpowered if given too early, and I just needed some outside input on this thought. Much appreciated!

## Fast SSD Hosting With Reasonable Price \$1/Month With Max Resources – Prewebhost.com!

Prewebhost the one of the old web hosting provider now moving forward and has started new services like free web hosting, \$1 ssd hosting, best ssd reseller hosting, high resourced wordpress hosting and much more. Fast ssd hosting with Reasonable Price \$1/Month. Our Aim at Prewebhost is simply to provide superior quality Shared Hosting services at the best price along with the highest customers happiness. We give emphasis particularly on uptime together with customer happiness, with the best servers on the market together with efficient support staff, our effectiveness is right up there with the best.

Besides we are offering Best High Speed SSD Linux Shared Hosting Plans to make sure that everyone find a hosting plan that have all the desired features within their budget limitations. Following are some details of our different shared hosting plans, therefore sign up for our fast ssd hosting with Reasonable Price \$1/Month

SSD_EXITE : \$1 / Month
– 3GB SSD Web Space
– Double domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

SSD_EXTRA : \$4 / Month
– 6GB SSD Web Space
– Ten domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

SSD_EXPERT : \$6 / Month
– 25GB SSD Web Space
– 25 domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

SSD_EXTREME : \$8 / Month
– 60GB SSD Web Space
– 100 domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

Special Features

Unlimited Sub Domains
Unlimited Parked Domains
Free Web Mail
Unlimited E-mail Forwarders
Unlimited Auto Responders
Free Softaculous with over 230 Apps
Free ImageMagick
Free PHP5.2 x Support
Free PEAR Support
Free Zend Optimizer
Free RVSiteBuilder
Free Custom Error Pages
Free SSL

https://www.prewebhost.com/cheap-ssd-hosting.php

Thank you.

## Fast SSD Hosting With Reasonable Price \$1/Month With Max Resources – Prewebhost.com!

Prewebhost the one of the old web hosting provider now moving forward and has started new services like free web hosting, \$1 ssd hosting, best ssd reseller hosting, high resourced wordpress hosting and much more. Fast ssd hosting with Reasonable Price \$1/Month. Our Aim at Prewebhost is simply to provide superior quality Shared Hosting services at the best price along with the highest customers happiness. We give emphasis particularly on uptime together with customer happiness, with the best servers on the market together with efficient support staff, our effectiveness is right up there with the best.

Besides we are offering Best High Speed SSD Linux Shared Hosting Plans to make sure that everyone find a hosting plan that have all the desired features within their budget limitations. Following are some details of our different shared hosting plans, therefore sign up for our fast ssd hosting with Reasonable Price \$1/Month

SSD_EXITE : \$1 / Month
– 3GB SSD Web Space
– Double domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

SSD_EXTRA : \$4 / Month
– 6GB SSD Web Space
– Ten domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

SSD_EXPERT : \$6 / Month
– 25GB SSD Web Space
– 25 domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

SSD_EXTREME : \$8 / Month
– 60GB SSD Web Space
– 100 domain hosting
– Softacolous single click script library
– Incremental backups
– Private nameservers
– Single addon domain

Special Features

Unlimited Sub Domains
Unlimited Parked Domains
Free Web Mail
Unlimited E-mail Forwarders
Unlimited Auto Responders
Free Softaculous with over 230 Apps
Free ImageMagick
Free PHP5.2 x Support
Free PEAR Support
Free Zend Optimizer


text:
At constant T and P, which one of the following statements is correct for the reaction, $\mathrm{CO}\left(g\right)+\frac{1}{2}{\mathrm{O}}_{2}\left(g\right)\to {\mathrm{CO}}_{2}\left(g\right)$ [AIIMS 1982, 83; KCET 1988; BHU 1995; MP PET 1997, 99]

(1) ΔH is independent of the physical state of the reactants of that compound

(2) ΔH > ΔE

(3) ΔH < ΔE

(4) ΔH = ΔE

Concept Questions :-

Internal Energy and work done
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

For the reaction of one mole of zinc dust with one mole of sulphuric acid in a bomb calorimeter, ΔU and w correspond to [AIIMS 2005]

(1) $\mathrm{\Delta }U<0, w=0$

(2) $\Delta \text{U}=0,\text{\hspace{0.17em}}w<0$

(3) $\Delta \text{U}>0,\text{\hspace{0.17em}}w=0$

(4) $\Delta \text{U}<0,\text{\hspace{0.17em}}w>0$

Concept Questions :-

Internal Energy and work done
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

If ΔH is the change in enthalpy and ΔE the change in internal energy accompanying a gaseous reaction [KCET 1989; CBSE PMT 1990]

(1) ΔH is always greater than ΔE

(2) ΔH < ΔE only if the number of moles of the products is greater than the number of the reactants

(3) ΔH is always less than ΔE

(4) ΔH < ΔE only if the number of moles of the products is less than the number of moles of the reactants

Concept Questions :-

First Law of Thermodynamics
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Enthalpy for the reaction C + O2 → CO2 is [DPMT 1987, 91]

(1) Positive

(2) Negative

(3) Zero

(4) None

Concept Questions :-

Enthalpy and It's Type
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

The work done in ergs for the reversible expansion of one mole of an ideal gas from a volume of 10 litres to 20 litres at 25°C is

(1) $2.303×298×0.082\text{\hspace{0.17em}}\mathrm{log}\text{\hspace{0.17em}}2$

(2) $298×{10}^{7}×8.31×2.303\text{\hspace{0.17em}}\mathrm{log}\text{\hspace{0.17em}}2$

(3) $2.303×298×0.082\text{\hspace{0.17em}}\mathrm{log}\text{\hspace{0.17em}}0.5$

(4) $8.31×{10}^{7}×298-2.303\text{\hspace{0.17em}}\mathrm{log}\text{\hspace{0.17em}}0.5$

Concept Questions :-

First Law of Thermodynamics
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

In a reversible isothermal process, the change in internal energy is

(1) Zero

(2) Positive

(3) Negative

(4) None of these

Concept Questions :-

Thermodynamics' Properties and process
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

The enthalpy of neutralization of which of the following acids and bases is nearly –13.6 Kcal [Roorkee 1999]

(1) HCN and NaOH

(2) HCl and KOH

(3) HCl and HCN

(4) HCl and NH4OH

Concept Questions :-

Hess's Law
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Work done during isothermal expansion of one mole of an ideal gas from 10 atm to 1 atm at 300 K is (Gas constant = 2) [AIIMS 2000]

(1) 938.8 cal.

(2) 1138.8 cal.

(3) 1381.8 cal.

(4) 1581.8 cal.

Concept Questions :-

First Law of Thermodynamics
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

Joule-Thomson expansion is [JIPMER 2000]

(1) Isobaric

(2) Isoenthalpic

(3) Isothermal

(4) None of these

Concept Questions :-

Thermodynamics' Properties and process
High Yielding Test Series + Question Bank - NEET 2020

Difficulty Level:

In an adiabatic expansion of an ideal gas [KCET (Med.) 2001; MH CET 2000]

(1) W = –ΔE

(2) W = ΔE

(3) ΔE = 0

(4) W = 0

Concept Questions :-

CP and CV and Relation for Real Gas


text:
1. ## Re: Westpac Maths Comp marathon

Originally Posted by d3st1nyLiang
is it a)?

A lucky number is a positive integer which is 19 times the sum of its digits. How
many different lucky numbers are there?
I don't know if my methods right:
By using the conditions in the questions. It's easy to deduce that the number isn't a 1,2 or 4 digit number. So it's a 3 digit no.
Let the digits be as follow: 100 digits in hundreds place, 10 digits in 10s place and 10 digits in 1's place.

Alternatively, I think you can just go:
Z*19=ABC where {Z,A,B,C E Z}
So say for: a no. which has digits summing to 6 is:
6*19=114

Thus, Z is in between 5 and 16
So 10 numbers.

2. ## Re: Westpac Maths Comp marathon

Originally Posted by shaon0
I don't know if my methods right:
By using the conditions in the questions. It's easy to deduce that the number isn't a 1,2 or 4 digit number. So it's a 3 digit no.
Let the digits be as follow: 100 digits in hundreds place, 10 digits in 10s place and 10 digits in 1's place.

Alternatively, I think you can just go:
Z*19=ABC where {Z,A,B,C E Z}
So say for: a no. which has digits summing to 6 is:
6*19=114

Thus, Z is in between 5 and 16
So 10 numbers.
Close, the actual answer is 11 :|

Here is the solution:

As shaon showed, the lucky number must be a 3 digit number.

Suppose the number is abc.

Then $100a + 10b + c = 19a + 19b + 19c$, we have:

$81a = 9b + 18c$

ie

$9a = b + 2c$

Note that as b and c are the ten's digit and unit's digit respectively, then

$0 \le b,c \le 9$

So the maximum $(b,c)$ is $(9,9)$ and therefore the maximum a is

$9a = 9 + 2 \times 9$

$\implies a = 3$

So we must only check for $a = 1,2,3$

For a = 1, we have $(b, c) = (1, 4), (3,3), (5,2), (7,1), (9,0)$
For a = 2, we have $(b, c) = (0, 9), (2,8), (4,7), (6,6), (8,5)$
For a = 3, we have $(b, c) = (9, 9)$, and there are no other solutions.

Hence there are exactly 11 lucky numbers, namely, $114, 133, 152, 171, 190, 209, 228, 247, 266, 285, 399.$

We should post up easier questions first just to get the marathon going =)

3. ## Re: Westpac Maths Comp marathon

PROBLEM 3

Tina has a large number of 1 × 2 × 6 rectangular blocks. She wants
to make a solid cube out of the blocks. What is the smallest number
of blocks she needs?

(A) 6 (B) 12 (C) 18 (D) 36 (E) 144

4. ## Re: Westpac Maths Comp marathon

or is it (c)?

5. ## Re: Westpac Maths Comp marathon

Originally Posted by kurt.physics
Close, the actual answer is 11 :|

Here is the solution:

As shaon showed, the lucky number must be a 3 digit number.

Suppose the number is abc.

Then $100a + 10b + c = 19a + 19b + 19c$, we have:

$81a = 9b + 18c$

ie

$9a = b + 2c$

Note that as b and c are the ten's digit and unit's digit respectively, then

$0 \le b,c \le 9$

So the maximum $(b,c)$ is $(9,9)$ and therefore the maximum a is

$9a = 9 + 2 \times 9$

$\implies a = 3$

So we must only check for $a = 1,2,3$

For a = 1, we have $(b, c) = (1, 4), (3,3), (5,2), (7,1), (9,0)$
For a = 2, we have $(b, c) = (0, 9), (2,8), (4,7), (6,6), (8,5)$
For a = 3, we have $(b, c) = (9, 9)$, and there are no other solutions.

Hence there are exactly 11 lucky numbers, namely, $114, 133, 152, 171, 190, 209, 228, 247, 266, 285, 399.$

We should post up easier questions first just to get the marathon going =)
Yeah it is 11. lol. I counted my solutions in between 5 and 16 incorrectly.

6. ## Re: Australian Maths Competition

Originally Posted by kurt.physics
Here is 2008 q + a and 2006 answers.
Hi Kurt,

Thanks for these papers and answers for AMC. For some years there was just the answers and not teh solution methods as such. Can you send these also if you have, say for 2008, 2006,2005,2004 and 2003? I am taking part inthe JUnior level. Thanks.

7. ## Re: Westpac Maths Comp marathon

Originally Posted by nerdsforever
or is it (c)?

Here my solution:

$What ever way Tina arranges the rectangular boxes, each side of the box must evenly divide the side of the cube. This implies that the side of the cube is a multiple of\,1, 2\, and\, 6\, and therefore the side of the cube is a multiple of\, LCM[1,2,6] = 6$

$The smallest multiple of\,6\,is\, 6\,, so the volume of the cube is\, 6^3$

$The volume of each rectangular box is\,1 \times 2 \times 6 = 12$

$So the smallest amount of boxes Tina will need is:$

$\frac{6^3}{12} = 18 \implies \boxed{C}$

8. ## Re: Australian Maths Competition

I think I am meant to be in this >_>... I'm really not in the mood for doing this since the Trials are just around the corner and all I've focused on is the syllabus and not really extra curricular (interesting maths ...).

Ima probably end up with just a participation or a credit if I'm lucky probably. Not that I care XD

thx kurt!

10. ## Re: Westpac Maths Comp marathon

Cheers kurt! you're awesome. what do you usually get in the maths comp?

Here's a new question.

A sequence {u1, u2, . . . , un} of real numbers is defined by

$u_{1} = \sqrt{2}$
$u_{2} = \Pi$

$u_{n} = u_{n-1}- u_{n-2}$ for n≥ 3.

What is u2008?
(A) −√2
(B) 2008(√2 − 2008pi)
(C) 1003√2 − 1004pi
(D) pi
(E)√2

Is it E) ?

12. ## Re: Westpac Maths Comp marathon

Originally Posted by nerdsforever
Cheers kurt! you're awesome. what do you usually get in the maths comp?

Here's a new question.

A sequence {u1, u2, . . . , un} of real numbers is defined by

$u_{1} = \sqrt{2}$

$u_{2} = \pi$

$u_{n} = u_{n-1}- u_{n-2}$ for n≥ 3.

What is u2008?
(A) −√2
(B) 2008(√2 − 2008pi)
(C) 1003√2 − 1004pi
(D) pi
(E)√2
$u_{n} = u_{n-1} - u_{n-2}$

$u_{1} = \sqrt{2}$

$u_{2} = \pi$

$u_{3} = \pi - \sqrt{2}$

$u_{4} = (\pi - \sqrt{2}) - \pi = - \sqrt{2}$

$u_{5} = - \sqrt{2} - \pi + \sqrt{2} = - \pi$

$u_{6} = - \pi + \sqrt{2}$

$u_{7} = - \pi + \sqrt{2} + \pi = \sqrt{2}$

$u_{8} = \sqrt{2} + \pi - \sqrt{2} = \pi$

We see the pattern emerging s.t.

$u_{1} = u_{7}$

$u_{2} = u_{8}$

$u_{n} = u_{n+6}$

So consider the pattern in modulo 6.

The 2008th term will be equivalent a specific residue modulo 6 and hence we can determine which term the 2008th term is equivalent to

$2008 \equiv 4 \mod 6$

$u_{2008} = u_{4} = - \sqrt{2} \implies \boxed{A}$

13. ## Re: Westpac Maths Comp marathon

Problem 5

The sum of three numbers is 4, the sum of their squares is 10 and the sum of their
cubes is 22. What is the sum of their fourth powers?

14. ## Re: Australian Maths Competition

I re-found the website which has the papers =)

AMC papers (this is in Chinese ;P)

AMC papers (in English)

15. ## Australian Mathematics Competition

Hi everyone~
i was just wondering if anyone had the AMT solutions for year 2002 - 2006 (intermediate division)???

16. ## Re: Australian Mathematics Competition

Originally Posted by appl3licious
Hi everyone~
i was just wondering if anyone had the AMT solutions for year 2002 - 2006 (intermediate division)???
Here they are =)

17. ## Re: Australian Maths Competition

I have posted the solutions here

Solutions

18. ## Re: Australian Mathematics Competition

Originally Posted by kurt.physics
Here they are =)
thank you for sharing~ u really saved me ^^

19. ## Re: Westpac Maths Comp marathon

A train travelling at constant speed takes a quarter of a minute to pass a signpost
and takes three-quarters of a minute to pass completely through a tunnel which is
600m in length. The speed of the train, in kilometres per hour, is
(A) 50 (B) 56 (C) 64 (D) 72 (E) 80

I really dont get this question, even though it is extremely simple. Shouldnt it be 48 km/h?

BTW no idea to the above.

20. ## Re: Westpac Maths Comp marathon

How many different pairs of 2-digit numbers multiply to give a 3-digit number with
all digits the same?
(A) 5 (B) 6 (C) 7 (D) 8 (E) 9

21. ## Re: Westpac Maths Comp marathon

For the train Q, (D) is the answer.
Remember that the train takes 45 seconds to travel the distance of 600m+its own length.

22. ## Re: Westpac Maths Comp marathon

Originally Posted by Lukybear
How many different pairs of 2-digit numbers multiply to give a 3-digit number with
all digits the same?
(A) 5 (B) 6 (C) 7 (D) 8 (E) 9
111=37x3
222=37x6
333=37x9
444=37x12
555=37x15
666=37x18
777=37x21
888=37x24=74x12
999=37x27
(C) 7.

23. ## Re: Westpac Maths Comp marathon

Originally Posted by kurt.physics
Problem 5

The sum of three numbers is 4, the sum of their squares is 10 and the sum of their

cubes is 22. What is the sum of their fourth powers?
$\\x+y+z=4 \\x^2+y^2+z^2=10 \\x^3+y^3+z^3=22 \\ \\x^2+y^2+z^2=(x+y+z)^2-2(xy+yz+zx) \\10=16-2(xy+yz+zx) \\xy+yz+zx=3 \\ \\x^3+y^3+z^3-3xyz=(x+y+z)(x^2+y^2+z^2-xy-yz-zx) \\22-3xyz=4(10-3) \\xyz=-2 \\ \\x^4+y^4+z^4=(x^2+y^2+z^2)^2-2xyz(x+y+z) \\=100+4(4) \\=116 \\ \\LOL... This way is too complicated.$

24. ## Re: Westpac Maths Comp marathon

Originally Posted by kurt.physics
Problem 5

The sum of three numbers is 4, the sum of their squares is 10 and the sum of their
cubes is 22. What is the sum of their fourth powers?
Consider polynomial: P(x)=x^4-4x^3+8x^2+(8/3)x+a0

S1=a+b+c=4
--> S1-4=0

S2=a^2+b^2+c^2=10
-->S2-4(S1)+16=0

S3=a^3+b^3+c^3=22
--> S3-4(S2)+8(S1)+8=0

S4=a^4+b^4+c^4=x
--> S4-4(S3)+8(S2)+(8/3)S1+4(y)=0

S4=88-80-32/3-4a0

S4=-(8/3+4a0) Where a0 is the constant of P(x)

Thought this method would work but i would need to know a0 for it to work...fml

The method your looking for though i'll do tomoz if not answered

Update: Above was the method i was referring to

25. ## Re: Westpac Maths Comp marathon

*study freak:

what rule is applied when you say:
x^2+y^2+z^2 = (x+y+z)^2 - 2(xy+yz+xz)

Page 2 of 14 First 123412 ... Last

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•


text:
# How to set \framed to make the baseline of the whole \framed as same as the first line in this \framed in ConTeXt?

An simple example:

\starttext
\setupframed[align=right,frame=off,offset=none]
\framed{A\hskip3em\framed{B\\ C}}
\stoptext

How can I set the framed which contains B\\ C so that the baseline of \framed{B\\ C} can have the same baseline with the first line B?

The same result can be achieved in plain TeX as follows:

\hbox{\vtop{\hbox{A}}\hskip3em\vtop{\hbox{B}\hbox{C}}}

What's the method in ConTeXt?

-

You need location=top, see Wiki - setupframed for more options.
\starttext


text:
### Home > MC2 > Chapter 11 > Lesson 11.2.3 > Problem11-51

11-51.

Nicole has a random number generator that will produce the numbers from $1$ through $50$ when she pushes a button. If she pushes the button, what is:

1. P(multiple of $10$)?

Multiples of $10$ are: $10$, $20$, $30$, $40$, and $50$.

Since there are $50$ possible outcomes and only $5$ of those
outcomes are multiples of ten, what is the probability of
getting a multiple of $10$?

2. P(~$100$)?

The random number generator only produces numbers from
$1$ through $50$. So what is the probability of not getting $100$?

3. P(~multiple of $4$)?

Some multiples of $4$ are: $4$, $8$, $12$, $16$, $20$. Find the rest of
the multiples of $4$ between $1$ and $50$.

There are $12$ multiples of $4$ between $1$ and $50$. So what is the
probability of NOT getting any of these $12$ numbers?

$\frac{38}{50}$

4. P(one-digit number)?

How many one-digit numbers are between $1$ and $50$?

The only one-digit numbers are $1$ through $9$. So what is the
probability of getting a one-digit number?