Tuesday, August 31, 2010

Can you kill backtracking?

Here's a problem that has appeared at a recent contest: We are given a 7 times 7 field where some of the cells have numbers between 0 and 8, inclusive, and all remaining cells have dots. We want to find such allocation of exactly 10 stars to the cells with dots, at most one star per cell, so that each cell with a number has exactly that number of stars in its 8 adjacent cells. Moreover, we will only consider such 7 times 7 fields where such allocation of 10 stars exists and is unique.

Can you create a testcase for this problem that will kill backtracking solutions? It seems pretty hard to do at such small field, but it is possible!

Here are the official rules of this challenge: http://killbacktrack.appspot.com/rules.jsp.
And here's the website where you can test your testcases, which also keeps a scoreboard: http://killbacktrack.appspot.com/.

I've got a pretty good testcase, but I don't want to reveal it yet :) Please tell if there's some problem or possible improvement to the website.

linear programming for dummies

March, my birthday, and I'm still here!

Hi Readers! I am still here responding to people's requests for homework help, I just don't post the answers on my blog as much anymore. But rest assured, I am still here answering your emails.

Also, to celebrate my birthday this week, I invite you to partake in this fun online gaming experience called "Auditorium"!

http://www.playauditorium.com/

I enjoyed it so much that I played it all the way through on my first sitting!


free math help

Help on Polynomial Factoring Calculator

Introduction to learn factor polynomials calculator:

In this article let me help you on Polynomial Factoring Calculator. It is used to solve different types of problems. It is a web-based tool designed to solve different problems.Learning factor polynomials through calculators is simple.

factor polynomials calculator are used to understand the polynomials factorization. Given expression can be factorized by using the greatest common factor. Let us discuss about the learn factor polynomials calculator.
Steps to Learn factor polynomials calculator:

The Steps to learn factor polynomials are as follows:

* Given expression can be arranged in the order of powers.
* Expression can be in the form of standard ax2 + bx + c = 0.
* The expression should be factorized.
* Solve the given terms.This could also help us on p value calculator

! Keep r eading may be in the next session let me help you on Intersection Circle

factor polynomials calculator

Tutorial--T-Shirt Yarn

**This tutorial is intended for personal use only.**

About 5 years ago, I prepared a tutorial with pictures showing how to create yarn from cotton t-shirts. Wouldn't you know it, when I looked for it this morning to post to my blog, it was nowhere to be found. I want to apologize in advance for the quality of this new tutorial. It was done early this morning when the lighting was poor. I also found it difficult to shoot several of the steps because what I really needed were 3 hands instead of 2.

T-shirt yarn is a very durable yarn. It is outstanding for making rugs and trivets in either crochet or knit. You will need to use a larger crochet hook or knitting needle than you normally would to comfortably be able to deal with this yarn. I have tried it in many widths, from 1/2-inch strips which produced a thinner, more flexible yarn to 1-1/2-inch strips which produced a chunky, stiff yarn. Today's yarn was made using 1-1/4-inch strips which was per! fect for the project that I had in mind.

Okay, I will start off by saying that I have had these t-shirts sitting around my house for over 3 months just taking up space. And no, before you ask, I did not steal my hubby's favorite t-shirts! (foa da Hawaii peeps, no, I neva kakaroach um,okay...LOL) The intent was to donate these shirts to charity. Unfortunately, I have been really lazy and never got around to doing that. So instead, I've decided to turn them into t-shirt yarn for future projects just to get them out of the way.

Luckily the t-shirts that I have to work with are in a good array of colors so eventually it will give me a nice variety to work with.

**Please note that only the unprinted, plain portions of the t-shirts are suitable to make into yarn. The ink and printed images are stiff and will not allow the yarn to curl under and form a smooth tube.



Start by placing a t-shirt onto a flat work surface. Straighten the t-shirt so that the hemmed edge lines up neatly.




Using a sharp scissor or rotary cutter and ruler, cut away the bottom hem. Also remove the upper portion of the t-shirt with a straight cut right at the under arm. You will be left with a tube with the left and right sides open.



Take the bottom of the tube (closed end) and fold it upward, leaving a 1! -inch margin at the top.



Fold it once more, making sure that you keep the 1-inch margin at the top.




Start cutting your t-shirt into strips, leaving the upper 1-inch margin intact. If you find that it is too bulky to cut through all of the layers at once, only fold it once instead of twice and just cut longer strips. You can decide how wide you would like your strips to be. I have cut strips as small as 1/2-inch and as large as 1-1/2-inches.




This is what it should look like after you've finished cutting the strips.



Unfold the strips. Notice that you will still have the 1-inch uncut margin at the top.



The easiest way to do this step is to run your arm between the two layers of t-shirt with the uncut margin resting on top of your arm. The statement that I made about needing 3 hands comes in here. I couldn't have it draped over one arm ! and at the same time cut it as I was taking the picture. Impossible.




So, in order to be able to photograph and cut it at the same time, I placed a round plastic jar inside the t-shirt in place of my arm.




Take your scissor and make a diagonal cut from the top of the first slit to the bottom of the second slit on the opposite side.


This is what it should look like after the first cut...



Keep cutting diagonally until you've reached the end. Please note: You will need to go back to the beginning where you made your first cut. You will notice that it will still be joined in a circle. Make a small diagonal cut to open the circle. I find it easier to do this in the end as it can make things confusing trying to figure it out in the beginning.

You will end up with one continuous piece like this:



To turn this into yarn, take short ! sections of approximately 1 to 2 feet betwen both hands and give it a good tug. It should curl under forming a tube. Repeat throughout. This should take you just a couple of minutes to do. Easy, peasy and fun too.



This is what your yarn will look like after you have completed the above step.



Here is a ball of t-shirt yarn just aching to be turned into something fabulous.



Today I have chosen a quick and easy crochet project as an example of what something made from this yarn will look like. Upon completion, this will become a trivet to go under hot pots and pans.



Now go ahead and have fun with t-shirt yarn. And please don't limit yourself to just trivets and rugs. T-shirt yarn can be made into a whole lot more.







How about knitting a cute tote from your new-found yarn.

Aloha,
Lettie**This tutorial is intended for personal use only.**

dot language tutorial

Solving Quadratic Equations

Here are a few sites that may help you when solving quadratic equations:


Solving equations by factoring

Exploring Similar Triangles as an Extension of Radical Expressions

Home Nugget #4
Assigned on Friday May 14, 2010
Due on Monday May 17, 2010

In Algebra I text,

Read lesson 10-6 on similar triangles for comprehension. Then, solve:

Page 563 # 7 - 21 odd, 22

Page 564 # 23 - 30

ALSO!

For lessons 10-4 and 10-5, I came up with Prime Time Problem (PTP) questions to determine not just whether you investigated each lesson, but whether you developed a deep understanding. Let's turn the tables. This weekend, I'd like you to:
1. Develop
2. Write out
3. Answer

five questions that are grounded in lesson 10-6 and are of the same caliber as the questions I designed for you. Those of you who take good class notes will be able to refer back to the questions I am referencing from lesson 10-4 and 10-5.

similar triangles

Example 7.26: probability question

Here's a surprising problem, from the xkcd blog.

Suppose I choose two (different) real numbers, by any process I choose. Then I select one at random (p= .5) to show Nick. Nick must guess whether the other is smaller or larger. Being right 50% of the time is easy. Can he do better?

Of course, it wouldn't be an interesting question if the answer was no. Randall Munroe (author of the xkcd webcomic) offers a solution as follows:


1. Call the number you see x.
Calculate p(x) = (e^x)/(1 + e^x)
2. Draw u, a random uniform(0,1).
3. If u < p(x) then guess the hidden number is
smaller than the revealed one. Otherwise,
guess that it is smaller.


Munroe shows that the probability of guessing correctly is

N = 0.5 * (1-p(A)) + 0.5 * p(B)

where A is the sm! aller of the two numbers. In practice, this only gains us an advantage when the observed value is between about -20 and 20-- outside that range, calculation of p(x) results in numbers so close to 0 or 1 that no improvement over a 50% rate can be achieved. If I knew Nick were using this method, I could keep him to a 50% rate by always choosing numbers over 1000 or so. He can improve Munroe's solution by using p(x/100000), though at the cost of a poorer improvement near 0.

We'll check the logic by simulating the experiment.

SAS

The SAS solution requires a lot of looping (section 1.11.1) and conditional execution (section 1.11.2).


data test;
do i = 1 to 10000000;
real1 = uniform(0) * 1000 + 1000;
real2 = uniform(0) * 1000 + 1000;
if uniform(0) gt .5 then do;
env1 = real1;
env2 = real2;
end;
else do;
env1 = real2;
env! 2 = real1;
end;
if uniform(0) lt (1/(1 + exp(-1 ! * env1/1 00000))) then guess = "l";
else guess = "h";
correct = ((env1 < env2) and (guess eq "h")) or
((env1 > env2) and (guess eq "l")) ;
output;
end;
run;


We can test the performance using proc freq with the binomial option (section 2.1.9).


proc freq data = test;
tables correct / binomial;
run;

The FREQ Procedure

Cumulative Cumulative
correct Frequency Percent Frequency Percent
------------------------------------------------------------
0 4996889 49.97 4996889 49.97
1 5003111 50.03 10000000 100.00


Proportion 0.5003
ASE 0.0002
95% Lower Conf Limit 0.5000
95% Upper Conf Limit 0.5006

Exact Conf Limits
95% Lower Conf Limi! t 0.5000
95% Upper Conf Limit 0.5006

ASE under H0 0.0002
Z 1.9676
One-sided Pr > Z 0.0246
Two-sided Pr > |Z| 0.0491

Sample Size = 10000000


We can just barely detect the improvement-- but it took 10,000,000 trials to find CI that reliably exclude the possibility of a 50% success rate.




R

We begin by writing a function to calculate p(x/100000).


xkcdprob = function(x) {
1/(1 + exp(-1 * x/100000))}


Then we write a function to perform the experiment n times. Here we use the same process for picking the two numbers, choosing them to be Uniform between 1000 and 2000. In the code below we use the ifelse() function (section 1.11.2) to decide which envelope is shown first. The vectorization in R allows us to avoid loops entirely in wr! iting the code.


larger1 = function(n) {rea l1 = runif(n) * 1000 + 1000
real2 = runif(n) * 1000 + 1000
pickenv = (runif(n) < .5)
env1 = ifelse(pickenv,real1,real2)
env2 = ifelse(!pickenv,real1,real2)
guess = ifelse(runif(n) < xkcdprob(env1),"lower","higher")
correct = ((env1 < env2) & (guess == "higher")) | ((env1 > env2) &
(guess == "lower"))
return(correct)
}


Then we can run the experiment and check its results in one nested call, using the binom.test() function (section 2.1.9) to see whether the observed proportion is different from 0.5.


> binom.test(sum(larger1(10000000)),10000000)

Exact binomial test

data: sum(larger1(1e+07)) and 1e+07
number of successes = 5003996, number of trials = 1e+07, p-value =
0.01150
alternative hypothesis: true probability of success is not equal to 0.5
95 percent confidence interval:
0.5000897 0.5007095
sample estimates! :
probability of success
0.5003996

probability question