text:
# Power for two sample t test

I am trying to understand power calculation for the case of the two independent sample t-test (not assuming equal variances so I used Satterthwaite).

Here is a diagram that I found to help understand the process:

So I assumed that given the following about the two populations and given the sample sizes:

mu1<-5
mu2<-6
sd1<-3
sd2<-2
n1<-20
n2<-20

I could compute the critical value under the null relating to having 0.05 upper tail probability:

df<-(((sd1^2/n1)+(sd2^2/n2)^2)^2) / ( ((sd1^2/n1)^2)/(n1-1) + ((sd2^2/n2)^2)/(n2-1)  )
CV<- qt(0.95,df) #equals 1.730018

and then calculate the alternative hypothesis (which for this case I learned is a "non central t distribution"). I calculated beta in the diagram above using the non central distribution and the critical value found above. Here is the full script in R:

#under alternative
mu1<-5
mu2<-6
sd1<-3
sd2<-2
n1<-20
n2<-20

#Under null
Sp<-sqrt(((n1-1)*sd1^2+(n2-1)*sd2^2)/(n1+n2-2))
df<-(((sd1^2/n1)+(sd2^2/n2)^2)^2) / ( ((sd1^2/n1)^2)/(n1-1) + ((sd2^2/n2)^2)/(n2-1)  )
CV<- qt(0.95,df)

#under alternative
diff<-mu1-mu2
t<-(diff)/sqrt((sd1^2/n1)+ (sd2^2/n2))
ncp<-(diff/sqrt((sd1^2/n1)+(sd2^2/n2)))

#power
1-pt(t, df, ncp)

This gives a power value of 0.4935132.

Is this the correct approach? I find that if I use other power calculation software (like SAS, which I think I have set up equivalently to my problem below) I get another answer (from SAS it is 0.33).

SAS CODE:

proc power;
twosamplemeans test=diff_satt
meandiff = 1
groupstddevs = 3 | 2
groupweights = (1 1)
ntotal = 40
power = .
sides=1;
run;

Ultimately, I would like to get an understanding that would allow me to look at simulations for more complicated procedures.

EDIT: I found my error. should have been

1-pt(CV, df, ncp) NOT 1-pt(t, df, ncp)

-

You're close, some small changes are required though:

• The true difference in means is typically taken as $\mu_{2} - \mu_{1}$, not the other way around.
• G*Power uses $n_{1}+n_{2} - 2$ as degrees of freedom for the $t$-distribution in this case (different variances, same group sizes), following a suggestion from Cohen as explained here
• SAS might use Welch's formula or Satterthwaite's formula for the df given unequal variances (found in this pdf you cited) - with only 2 significant digits in the result one cannot tell (see below)

With n1, n2, mu1, mu2, sd1, sd2 as defined in your question:

> alpha   <- 0.05
> dfGP    <- n1+n2 - 2                     # degrees of freedom (used by G*Power)
> cvGP    <- qt(1-alpha, dfGP)             # crit. value for one-sided test (under the null)
> muDiff  <- mu2-mu1                       # true difference in means
> sigDiff <- sqrt((sd1^2/n1) + (sd2^2/n2)) # true SD for difference in empirical means
> ncp     <- muDiff / sigDiff              # noncentrality parameter (under alternative)
> 1-pt(cvGP, dfGP, ncp)                    # power
[1] 0.3348385

This matches the result from G*Power which is a great program for these questions. It displays the df, critical value, ncp as well, so you can check all these calculations separately.

Edit: Using Satterthwaite's formula or Welch's formula doesn't change much (still 0.33*):

# Satterthwaite's formula
> var1  <- sd1^2
> var2  <- sd2^2
> num   <- (var1/n1 + var2/n2)^2
> denST <- var1^2/((n1-1)*n1^2) + var2^2/((n2-1)*n2^2)
> (dfST <- num/denST)
[1] 33.10309

> cvST <- qt(1-alpha, dfST)
> 1-pt(cvST, dfST, ncp)
[1] 0.3336495

# Welch's formula
> denW <- var1^2/((n1+1)*n1^2) + var2^2/((n2+1)*n2^2)
> (dfW <- (num/denW) - 2)
[1] 34.58763

> cvW   <- qt(1-alpha, dfW)
> 1-pt(cvW, dfW, ncp)
[1] 0.3340453

(note that I slightly changed some variable names as t, df, and diff are also names of built-in functions, also note that the numerator of your code for df is wrong, it has a misplaced ^2, and one ^2 too many, it should be ((sd1^2/n1) + (sd2^2/n2))^2)

-
thanks! The one thing is, doesn't this formula for df assume that the population standard deviations are equal? See page 3 of the following (where I got the Satterthwaite df): stata-journal.com/sjpdf.html?articlenum=st0062. Supposedly, SAS uses this approximation in the proc I posted. –  B_Miner Oct 15 '11 at 21:51
I found my error and adjusted above in my question. Thanks again! –  B_Miner Oct 15 '11 at 22:16
If you are mainly interested in computing the power (rather than learning through doing it by hand) and you are already using R then look at the pwr package and either the pwr.t.test or pwr.t2n.test functions. (these can be good to verify your results even if you do it by hand to learn).


text:
# Weapon developed in modern melee only world

Let's say a global law has been passed in the year 2000 that disallows any projectile, explosive or otherwise long distance weapon or put differently, only allows variations of melee weapons. Thrown weapons (like throwing stars) are also banned. The reason for this was that weapons became more and more weapons of mass destruction and after the success banning chemical warfare it was decided to go down that route a lot farther. So what kind of weapons would be developed in such a world? Do thus feel free to assume that 1) everybody obeys these laws 2) even more money than in the last 14 years was spend on weapon development, so weapons can be a bit fantasy-like/unreal from our perspective. and 3) armor might have gotten better.

I am looking for something that could develop within 50 years of the ban (so out to 2050).

To be precise, I am actually trying to think of the back story for the development of a very specific type of weapon and am trying to find out whether this would actually give rise to such weapons. I might self answer later with that line of thought, but I would absolutely love seeing what you guys think.

And just to be clear, anything that doesn't put the user physically in the battle, physically being connected to the entire weapon does not count. No javelins, laser beams, bullets, etc.

• How do you get criminals to obey these laws? Especially if the cops and army do? – Oldcat Dec 5 '14 at 19:42
• I'm reminded of Dune. High velocity impact weapons become infeasible due to personal shield generators. Low velocity (stabbing) weapons become preferred. Knifes rule for personal combat, with fighting styles optimized to pierce the opponents shield at just the right speed. – Tonny Dec 5 '14 at 20:15
• Yeah, because criminals follow laws (nevermind otherwise law-abiding people who would object to a global law)... The law you need changed is a law of physics. Don't balk, it's a simpler change than entirely rewriting the human psyche. – Smithers Dec 5 '14 at 22:00
• Read this book en.wikipedia.org/wiki/All_You_Need_Is_Kill , it will help you to visualize the conditions in which projectile weapons become useless. Some are, many agile enemies or swarm like tactics. Guns are good in people vs people comba, fighting one other person with 300 rounds is fine because one well placed shot can kill him. He also makes a good target, people are quite big. However imagine having 300 rounds and being attacked by 400 rats or other small rodents, I doubt you will be able to kill even 50 before you run out of bullets or die. Hitting something that small is hard. – unom Dec 5 '14 at 22:36
• in Tenebreuse saga (McCaffrey), there was a global opposition to range weapon. This was due to a war where psy powers were used at distance. Any one using range weapon would face the wrath of every other people. Nobles would throw everything they got, even forgotting feud between famillies, to kill the miscreants. – PATRY Guillaume Dec 9 '14 at 18:40

I don't think that melee weapons would significantly change in 14 years of development, other than some re-purposing of tools designed for other uses. Lightsabers and other similar future weapons are, as of right now, purely in the realm of sci-fi, and aren't well supported by modern science. I do, however, see some changes to existing melee weapons, development of new weapons, and development of related battlefield technologies likely:

### Changes to existing weapons

Changes to existing melee weapons would fall mainly in terms of manufacturing process and materials. I imagine that something like a sword or a spear would consist of lightweight, durable modern materials like titanium and high strength nickel alloys, similar to what are seen in aerospace applications. Shock absorbant technologies have also progressed significantly, so work would probably be done in hilt/handle design to make weapons easier to maneuver in combat. It would also probably be possible to develop powered gyroscopic systems for controlling the rotational inertia of a weapon, making it easier to swing harder and recover from swings faster.

### Development of new weapons

Existing technologies like captive bolt guns might also be adapted as a way to increase the lethality of weapon users. Weapons could also be adopted from tools like chainsaws and jackhammers, though the weight of such systems may be prohibitive. Complex weapons with lots of moving parts would also be more susceptible to being damaged or broken in combat.

### Other technologies

For military applications, melee combat would put far more pressure on armoring and strengthening combatants, which would lead to probably the biggest technological shift in militarily combat: powered armor. This is a technology that's already being developed, and I imagine that a few hundred billion dollars could rapidly take it from something that is being developed to increase mobility in disabled people to a powerful battlefield weapon quite quickly. Without the threat of being destroyed by far cheaper weapons systems like RPGs, powered armor could make a fighter virtually invulnerable to the kind of damage that other soldiers could do with hand held melee weapons, no matter how advanced those weapons are.

Tactically, armored vehicles would have an even bigger advantage than they do now. A tank equipped with cutting blades could mow through infantry with impunity, since the elimination of explosives and projectiles would remove almost everything that infantry could do in response. I imagine the only thing that could stand effectively against a melee tank would be soldiers in powered armor, which would probably have better agility than the tank, and could effectively wield heavy power tools for puncturing their armor.

• I wonder if a shaped change that you manually attach to a vehicle would be allowed. That would probably change the infantry vs. armor dynamic, especially if you had some sort of retracable arm for placing it. – KSmarts Dec 5 '14 at 19:36
• Additionally, imagine the kind of "powered" melee weapons we could have. Say a lance that propels forward at high speed, or a sword designed to extend spikes outwards after impaling an enemy. You could get very creative with killing, maiming, and even "peaceful" applications by using advanced technology with melee-type weapons. – Thebluefish Dec 5 '14 at 19:40
• A tank without a projectile weapon is pretty useless. The Infantry could just stand up and move aside. – Oldcat Dec 5 '14 at 19:41
• They'd also be great for breaking up infantry formations clumped together to defend against things like motorcycle cavalry. – ckersch Dec 5 '14 at 19:52
• I suspect that weapons would probably use composites in addition to metal alloys. Just look at the javelins used in the modern olympics, or composite bats in (non-major-leauge) baseball. – 2012rcampion Dec 5 '14 at 21:13

With that kind of restriction, people are sure to turn to Loophole Abuse (warning: TV Tropes link). The requirement that the user be holding or connected to the weapon while using it doesn't strictly prevent the use of all ranged weapons. Anything that is thrown, launched, or shot, but still held or connected by a rope, chain, or cable sounds like it would still be allowed. This would include things like meteor hammers, gladiator-style weighted nets, or, as GrandmasterB observes, a taser.

I picture people creating hand-cannons that shoot spears, cannonballs, or nets with light cables attached. There would be a mechanism for quickly retracting the cable, or, in case an enemy got ahold of it, detaching the cable.

This may not be particularly effective in battle, but they could be used a few times a the beginning of a fight before closing range--just like Roman javelins, except they're technically still handheld.

• "I've got a bow and arrow, but it's a melee weapon because all of the arrows are connected to me with pieces of string." – ckersch Dec 6 '14 at 18:28
• How about a en.wikipedia.org/wiki/Wire-guided_missile? – March Ho Dec 25 '14 at 14:16

I could see the extensive use of electrical stun weapons. From small, concealable hand-held stunners to long pike-like devices with a lot of reach. They are cheap and easy to make, effective, and can 'scale up' to be used against armored opponents.

Traditional 'Taser' guns might also be used, based on your boundaries, because the barbs they shoot are technically connected by wires to the gun.

• Not technically connected, they are connected. – Oldcat Dec 5 '14 at 18:24

Huge mindset shift is needed in order to make the ban happen:

I am just going to list several "honorable mentions" of people or states or organisation drastically changing their approach:

• The Mafia everywhere, generally organised crime members will suddenly care about law... because laws should be followed.
• Democratic Peoples Republic of Korea (a.k.a. North Korea) will hand out all their weapons in fear of international sanctions. And we all know, that sanctions worked well against DPKR
• All protectors of second amendment in USA will understand it the same way as I do, and it is: The right to have weapon means actually sword and not firearm
• All history freaks, doomsday preparation freaks and everyone will hand out their weapons

And yet...

After doing so, they will return home and Taliban will continue plan of attacking the World Trade Center, and George W. Bush will invade Afghanistan (using swords only) ... and so on.

To me, ultimately:

If everyone will be willing to follow the "no firearms" law, it means world peace

After handing out all their weapons, the only plausible way to continue is, that North and South Korea leaders will shake hands and say "we both are Koreans, so why fighting?" Taliban will apologise to US, African leaders (Gaddaffi was still alive to name one) will throw in democratic elections ... And world will become happy place.

So, the initial setup cannot plausibly lead to any meele only weapon

• I purposely avoided attacking the ridiculous premise, but I'll give you a +1 for doing so, even though you didn't answer the question asked. – IchabodE Dec 5 '14 at 21:23
• Limitations on warfare were maybe working to some extent. What I don't like on the question is that ** everyone** will be willing to get rid of firearms. DPKR is good example where limitations on warfare had no effect at all – Pavel Janicek Dec 6 '14 at 9:31
• @DavidMulder have any limitations on types of warfare been successful? Any restrictions that come to mind - chemical weapons, cluster bombs, land mines, etc have all been used many times after a "consensus" that they should be restricted. Furthermore, for any such restrictions the policy of the major power on "X is bad, don't use X" has been either (1) we don't use X, since we use Y that does it as good; (2) ok, we won't use X but we'll be ready to use X if we really really need it; or (3) we won't use X but we'll use nuclear weapons to retaliate if it appears (e.g. US policy on biowarfare) – Peteris Dec 6 '14 at 17:09
• Idea for how the premise could work: aliens have become disgusted with the warlike tendencies of humans and banned large sections of weapons. The aliens have advanced surveillance technology and will immediately kill anyone who uses a ranged weapon. – ckersch Dec 6 '14 at 18:30
• Again. 80% is far from "everyone" and that's where I have problem – Pavel Janicek Dec 7 '14 at 7:49

Any such rules against range weapons would be ignored. In a battle, your goal is to take any unfair advantage over opponent and kill him. It is not about fair play.

Chemical weapons were banned because chemical weapons do not give one side clear advantage, killing often your own soldiers when wind shifted, and otherwise maiming mostly civilians. See that nuclear weapons were not banned, because they do give advantage.

Also, it would be impossible to remove all existing range weapons. It would be huge incentive to keep secret stash, because it would give you huge advantage over any opponent attacking with only a melee weapons.

And when you are fighting for your survival, you are not interested in fair play.

If you think that any rules apply in the fight of survival, you are naive and will be eliminated - only non-naive will survive long-term.

Different matter are staged fights for entertainment or ritual reasons - like box, judo, medieval jousting. Even mixed martial arts do have rules - because it is a sport, not real fight.

• I would argue that the following of these "laws" would depend on the enforcement capabilities, if a few dozen large world governments jointly owned a super-weapon capable of instantly incinerating anyone from space and enforced the ban on ranged weapons with this I think it would be far more possible. The OP didn't make it clear that people willingly obey the law, just that they obey it. – Vality Dec 7 '14 at 2:53
• There is no such thing as "jointly owned super-weapon". Explain me how USA, China, Russia and EU would "jointly own" such thing. Whole point of such super-weapon is to make its ownership to be exclusive to allies, and exclude opponents. Only naive would believe that superpower would share. Yes, they may promise - but why to share is you can own it exclusively? There are always conditions to be added to anyone who should share such weapon. – Peter M. - stands for Monica Dec 7 '14 at 18:47
• And if you know your opponent is developing such weapon, the only rational response is to strike before it exist, while you still have a chance. Mutually-assured destruction. – Peter M. - stands for Monica Dec 7 '14 at 18:48
• Once a while my answers gains downvotes (with no comments), because it breaks someone illusions about war, and maybe martial arts as "real" fight. Oh well. Life is not fair, and then you die. – Peter M. - stands for Monica Apr 14 '15 at 0:06

I'll assume that trivially abused technologies such as hammers or chain weapons with rocket engines and shaped charge impact weapons are also banned. Same with chemical and biological weapons.

There also some important parameters unspecified in the question. Is it socially and legally acceptable to carry visible lethal weapons? Is duelling legal? Really, this is three questions: Optimal visible weapon to carry for self-defense AND duels. Optimal hidden self-defense weapon. And optimal formal duelling weapon. Of these the last two could really be anything depending on the legal and social parameters so I'll assume you are not interested in those.

For the first, I'd go with a sword. Swords have a tradition value that just cannot be beaten. And for a good reason. Unlike a gun that can be used for lethal damage or threatening with lethal damage, a sword can attack OR defend well, and even gives a degree of control over the damage you cause.

What kind of sword? Well, one reason "a sword" is an easy answer is because there is a sword for every need waiting for you in the history books. Some parameters: Is use of body armor allowed? Do the restriction s apply to actual wars or just peacetime use? From the question I am guessing you expect the restrictions apply during wars (unrealistic IMHO). That would imply needing a sword with reasonable armor penetration. A society like this would probably use augmented or powered armor. (Augmented = takes care of the weight of the armor, no power source strictly necessary; Powered = adds power source for enhanced strength and speed) With modern materials either could be essentially immune to small arms level damage. Explaining why the ban has a chance?

With those parameters a fast precise thrusting weapon with armor piercing point would seem optimal. That is generally called a rapier. With powered armor the rapier would probably be shorter and heavier. The weapon would be of modern alloys, corrosion resistant and almost impossible to break or bend. The tip, possibly the entire blade, would have hardened surface of something like diamond, sapphire, or silicon carbide, whatever is most convenient. There is no real point in giving the weapon enhancements for penetration as it is easier to improve thrusting strength mechanically at the armor. Even a light weight peace time street armor would have more space for enhancements than the blade does and give all the benefits of a heavy swung weapon but with better speed and precision.

It might make sense to give the blade an incapacitating attack after penetrating armor. Either an electric shock or a chemical injection of something like capsaicin would be simple enough to do, fair enough to be allowed, and quite effective at ending the fight. Which otherwise would be an issue with a weapon that is essentially an armor piercing point with some range. A hand-guard would be present obviously.

For off-hand I'd go with a shorter version of the same blade injecting less instant but longer lasting tranquillizers into opponents that you have temporarily incapacitated with the longer blade. Would also give more flexibility to melee range and be useful for parrying. As an alternate weapon maybe some sort of simple chain weapon for entangling the opponent?

And I suppose this would scale to "mecha" on battlefield, tanks and such being of limited use without cannon. The blades would be driven by high speed hydraulics and inject binary explosives. And the mecha might have four or six legs, probably with wheeled drive available.

The biggest change would be that without missile weapons, or some equivalent that would be equivalently banned, aircraft would be unstoppable. Troops could be rapidly and easily dropped anywhere in range, kept supplied, reinforced, and extracted. Ground warfare would be dominated by relatively light easily airlifted elite units adept at hit-and-run and rapid responses to hit-and-run. Such units would be based on the same the heavily defended bases as the aircraft that transport and supply them. Defenses would include "siege units", larger, heavier versions of the light units as well as static defenses. Similar defenses would be present at other strategic locations.

• I think you'd see robot-wars / battlebots weaponry on tanks. Powered, armor-piercing rams; wrecking balls; weaponized heat-based cutting tools (torch or electric). – Peter Cordes Dec 6 '14 at 19:15
• @PeterCordes Not so sure. Frankly the effect on military vehicles is kind of difficult to predict. The problem is that guns are one of the biggest forces on the evolution of military vehicles over the last few centuries. Without guns all that would have to be rethought from start. A tank for example is a mobile platform for guns with heavy armor to protect it from guns in a form factor designed to be harder to shoot at. Without guns? Yes, tanks would still be scary and could carry all kinds of weapons, they already do, but is that what people would actually do? I have no idea. – Ville Niemi Dec 6 '14 at 19:32
• I posted an answer of my own where I thought some more about things. Out-manoeuvring the enemy vehicles to reach an objective is much easier when they need to completely catch you to do anything to stop you. But I think you'd see bulky tough vehicles for defending the area right around important objectives. You're right that they wouldn't be used in anything even resembling tank vs. tank warfare. (although now that I think of it, I don't have much idea about how to use a force of tanks. I just know the names Rommel and Patton, not much about how they fought.) – Peter Cordes Dec 6 '14 at 19:40
• @PeterCordes Edited the last paragraph of my answer, largely due to your comments. – Ville Niemi Dec 6 '14 at 20:40
• @PeterCordes LOL, you actually pinpointed something that I could not solve when writing that new paragraph. How would you win or lose a war in this setting? Or would wars as we know simply vanish and be replaced something akin to modern special ops? No idea... – Ville Niemi Dec 7 '14 at 18:17

I'm going to say energy weapons will become the next great wave, light sabers/ion blades etc. Things that can cut indiscriminately through as many materials as possible.

One movie years ago had a villain that had a 'laser' thumb. His bionic thumb had some kind of ion cutting rope/string that acted like a small whip. but if it wrapped around anything it would cut right through it. Of course he died at the end when someone took his thumb and wrapped it around his neck.

If light isn't considered a 'projectile' then laser guns would be a big one on the docket. Chances are it would happen anyway whether legal or not. Quiet, invisible, are to trace.

Axes and pole-arms are good, don't need a lot of training to at least be useful.

Had another idea which I think those of us in the US would go for, sending in robots in our place. They aren't projectiles, but they do remove us from the action...

• It's 2014 right now and the best projected energy weapons we have that run on hand held batteries are pretty paltry (in terms of potential damage) to say a house hold hammer. – Culyx Dec 5 '14 at 17:42
• @Culyx I'd personally would go with an ax, if I could get a nice battle ax your in business. – bowlturner Dec 5 '14 at 17:44
• Agreed, something with a blade and a "pick axe" style protrusion for harder armor, best of both worlds – Culyx Dec 5 '14 at 17:45
• I think you are talking about Johnny Mnemonic. The weapon in question there is a Monomolecular Whip ( en.wikipedia.org/wiki/Monomolecular_wire )..the idea is that you make a strand out of a single molecule then it would both be extremely sharp and extremely strong, able to cut through virtually anything without resistance. – Tim B Dec 5 '14 at 20:38
• @TimB That's it! I honestly wouldn't have thought that was the movie. I'll have to watch it again soon. Wasn't it like a whole "2 gigs" of data they needed to write into his head? – bowlturner Dec 5 '14 at 20:43

You're looking for mechs, aren't you? Most advances in melee weapons that I immediately think of are going to be powered devices with several drawbacks for the common soldier. They will be heavy, they will need a power source, and they will have inertial issues that make them prohibitive.

That is unless you connect them to a frame with its own power source, has enough mass to handle the torque and inertia and mechanical assist to deal with the weight of the weapon. So, you need basically a mech. They'd start off human sized or slightly larger, but that would escalate quickly. You'd have melee weapons like chain-swords, probably with a blade nearly white-hot. I personally like a Jaws of Life style weapon made to peel back enemy armor like tissue paper. Artificial Intelligence assist would be a must, leading to more arms with more weapons.

Armor meant to turn back a knife blade would be a secondary concern since your primary concern would be an EMP. This soldier would fail entirely if it wasn't armored in essentially a farady cage.

• Actually not @mechs, ksmarts answer was the direction I was originally thinking of more, but fair enough :P – David Mulder Dec 6 '14 at 3:28

People don't carry personal weapons much any more; before firearms in Europe people carried rapier-like weapons, so those would probably return (albeit with slightly lighter and stronger blades due to advances in materials science). Swords are great weapons for civilian use: small enough to not get in your way most of the time, but almost all of the weapon is dangerous.

For wars--good grief, who would ever? Just drive cars or something into the enemy. Bus vs. pikemen = a bunch of dead pikemen. Bus vs. halberdiers = dead halberdiers.

This is all assuming you could even enforce such a law, which seems doubtful outside the context of alien occupation or some similarly vast technological gulf. (And then I don't think the lack of guns would be most people's first concern.)

• +1 for Bus vs. pikemen. literally loled. But yeah, a car is just a special case of the tank / powered armor that people would end up using. – Peter Cordes Dec 6 '14 at 19:08
• @PeterCordes - Powered armor is hard to do with modern tech (near-future now, perhaps, but it's not usefully here yet). Vehicles of all sorts, yes. Still, war is pretty awkward when you have to literally drive over your opponents. – Rex Kerr Dec 6 '14 at 20:46
• Vehicles can have a good variety of 'almost-ranged' weapons - i.e. captive bolt or extending spike variety weapons that allow a devastating kill at some limited but useful reach. – Peteris Dec 6 '14 at 21:59
• @Peteris - To some extent, but armor is strong compared to spikes (just watch old episodes of RobotWars). You mostly want to flip/crush, not puncture, because your opponent can just put a foot of reinforced steel around the whole thing, which is pretty much impenetrable to non-explosives. – Rex Kerr Dec 6 '14 at 22:17

I would suggest this kind of sword

The blade is split in 2 halve. In the center, you have an explosive charge and an accelerometer.

When the blade hit something (a piece of software make the difference between a block and a hit) the charge explode adding much power to the blow.

Of course, you add a repeating system.

Better materials I'd guess.

The dune saga might be a good starting point - projectile weapons were obsoleted by technology development (in that case, shielding that worked against fast moving projectiles resulted in a culture where bladed weapons were common. There's one case where they used artillery on planet, and it caught everyone by surprise).

Not counting magic forcefields - You might have low cost, ubiquitious , non newtonian materials for body armour (or even normal clothing) that could negate fast moving weapons. Maybe energy Point defence may work against larger projectile. In short the only way to penetrate that would be slower weapons.

Its worth considering millennia of better materials development. Consider significantly better materials, and metallurgy. Better ways of working on those materials as well.

Consider the Japanese Katana - A sharp hard edge, with a strong flexible core. You might have a diamond or ceramic edge, and a composite core instead of folded steel.

You'd also have better bows and crossbows - maybe autoloading servo actuated crossbows or electrical/electronic scopes to adjust for drop and wind speed for better accuracy. Arrows would be composite instead of wood and you could balance these precisely and fire them with much more consistent force

You'd have weapons optimised for certain roles. Explosive arrows for anti material roles or getting past hardened body armour, or specific weapons types for stabbing or tearing through 'soft' body armour, or assisted for punching through hard exoskeletons - maybe low speed, high pressure spike for hard exoskeletons for example.

Without ranged weapons, but with modern vehicles for transportation, you won't have a "front line" of fighting. Your enemies can drive or fly right up to your headquarters, and try to do whatever raid they have in mind.

Your HQ will have to be underground, or someone will fly up to it. 3 dimensions is too much to defend. You need to cut down access to your base to one dimension, through an access tunnel that your enemies can't just overwhelm or blitz.

If your enemy comes at you with transport helicopters full of guys, you can't just shoot them down, unless energy weapons are allowed. You'd need fighter aircraft to defend anything. Aircraft could try to tangle other aircraft in cables, or stick things into their engines or props / rotor blades. Short of kamikaze attacks, you could maybe make a personal-delivering missile with an armor penetrating nose. This counts as a vehicle because there's a guy inside it. He may have to fly it for this to work vs. your alien overlord lawyers enforcing this rule, but ok. So you fly your missile into the enemy plane, open a hatch, get out and wreak havoc. Hope you brought a parachute or jetpack.

As far as weapons go, personal weaponry might include variations on the captive bolt pistol, which has the advantage of not being muscle-powered. Those who aren't up to using swords might get more out of a powered spear. (captive bolt rifle = longer reach = spear).

And of course just running people over with vehicles will make it probably not viable to be an un-armoured combatant on a battlefield. Robot-wars tanks are the likely result of evolution of vehicular combat. Mecha maybe worth building, if they're better at stepping over wreckage. Because you have to be up-close and personal to fight at all, more fighting might happen near the objective. Without range, it's harder to stop your opponent just going around you. (or impossible, really, since they'll use transport helicopters.)

They could use powered exoskeleton. The suit is powered with small, high capacity batteries and can enhance the strength and speed of the soldier. It could be something similar to Iron man but with less advanced technology. They might be able to fly somehow, for short distance or more likely jump at great distances.

Eventually, some might decide to alters their body to become a cyborg: half man, half machine. They would do this to have an advantage in the battles or to replace severed limbs.

An army could also use robots but in that case nobody is fighting since everything is done by the machines. Robot fights could even become a source of entertainment and \$.

I think one version of 'powered' weapons would involve taking the mechanisms of projectile weapons and applying it to melee attacks. Imagine a war hammer that has a 'magazine' of high density fuel charges (something similar to the propellant used in rockets) that can be 'fired' to suddenly accelerate the hammer head toward the target.

There are no projectiles and a semi-automatic firing system would allow the wielder to deliver rapid heavy blows limited only by the balance/recovery (weight?) of the total weapon.

The other 'firing mechanism' similar to the above would be an impact trigger, landing a blow would trigger the fuel and a second high acceleration blow would follow the first blow.

Armor is largely limited by weight, enough armor can stop large directed impacts (like a pick axe) but the armor needed is heavy when thick enough to do this. I think this style of fighting would largely favor agility (not getting hit) as opposed to absorbing hits.

• I was thinking along those lines, too, a weaponized version of the captive-bolt cattle slaughter thing Javier Bardem killed people with in No Country for Old Men. – Peter Cordes Dec 6 '14 at 19:17

I don't know if the physics would support it, but I'm imagining some sort of hand-delivered shaped charge. Something like a powerhead, only bigger, and without a launchable bullet.

With the rise in heavy armor that would come with the removal of firearms, something like this would allow an unarmored person to still be a threat.

1. Lightsaber or energy/ion/plasma/lightning melee weapon.
2. gunsword or a hammer or lance with blank rounds at the tip. The explosive rounds at the end could detonate when hitting the opponent, to add explosive or armor piercing damage. Same as a powerhead, with the muzzle blast being the damage dealer.
3. Energy intensive objects, such as ultra high-speed gyroscopes that can be swung to cut the opponent.

The premise of why projectile weapons would be eliminated is the biggest influence on development. Generally speaking, rules do not apply to existential threats - I don't find it at all plausible that someone would just stand around helplessly while their friends and family are massacred and their entire civilization destroyed because they cannot use better weapons against a stronger opponent. You still want a world with warfare, rather than some pacifist utopia, so you will need some overriding reason behind people not using any projectiles - this will need to be so overriding that it must be specified before determining the direction of military development, which will be entirely shaped by your restrictions and the enforcement thereof.

For example, if you just want some tenuous physical connection, what about TOW missiles? They are anti-tank missiles which are still connected to the operator by a thin wire. This may meet the letter of the law and loopholes like that would allow the side with the most creative justifications to completely dominate.

If you want to restrict things to purely physical weapons (no explosive assists, pneumatic bolts, etc.), you are probably going back to soldiers wielding something like a bec de corbin and wearing heavy plate (albeit with modern alloys and synthetic fibers). With assists, a penetrating captive bolt war hammer or spear might be the favorite. Modern armor itself would be practically immune to most physically powered hand-held weapons, so impact weapons to kill through sheer concussive effects would be most prevalent.

Powered armor to greatly boost the strength of a soldier might give someone an edge by better penetrating armor, but the weak-point is still the soft fleshy thing inside it getting killed by the impact. Vehicles will probably dominate as they can carry better power and keep the driver protected from impact - running down individuals and ramming each other as best they can (maybe even modified jet powered craft hovering over troops to injure them with the hot exhaust).

Of course, soldiers meeting on the battlefield at all is unlikely unless you also rule out motorized transport to get around the defending soldiers to attack wherever. No way you could reliably defend against aircraft inserting enemy shock troops into your capital/factories/infrastructure without projectiles. Warfare becomes hit-and-run guerrilla tactics to force the collapse of your entire civilization.

If you are thinking about energy weapons, there is no plausible means of a human-carried power source being able to deliver nearly enough charge that even simple armor could not defeat. How far out do you want to go on the 'fantasy/unreal' end of things - if you are going to throw out the laws of physics to get things like lightsabers, or plasma whips, or whatnot, just go all the way and say they use a magic staff (magic also explains why there are no more projectiles, which is otherwise an implausible eventuality).

Everybody obeys these laws

I think that under certain historical conditions, you could get almost everyone to obey such laws. Say that there had been a war so grotesque, destructive, and genocidal that it engendered global revulsion toward the weapons that had enabled it (anything that lets you kill someone from a distance without them being able to fight back). Using such weapons would be seen as akin to raping a child, something even other criminals, as a whole, aren't likely to let you get away with. It wouldn't be the laws per se holding people back then, rather it would be simple moral consensus. However, that won't stop absolutely everyone.

Even more money than in the last 14 years was spend on weapon development, so weapons can be a bit fantasy-like/unreal from our perspective.

You can really go anywhere with that. Electrified whips, as someone mentioned, lightsabers, chainsaw-axes, powered exoskeletons for extra strength so you can hit people really, really hard with your morning star, ferraris with poisoned lances in the grill, all the way down to rocks and boards with one nail in them.

• We can't even get the population to obey road speed limits. – Oldcat Dec 16 '14 at 19:06
• I don't think the impetus for speed limits is analogous to the scenario I suggested – Aurast Dec 16 '14 at 20:47
• If someone was coming to kill your children, would you just attack the killers with a pointy stick despite knowing it was completely futile, and resign yourself to your family being slaughtered? How about your entire civilization? I know I would pick up a gun and try to save them - 'moral consensus' notwithstanding. – pluckedkiwi Dec 17 '14 at 14:16
• Being law abiding citizens, most people wouldn't have projectile weapons to defend their families with. As for someone trying to destroy your civilization, that is a situation where such weapons would probably be used. But destroying a civilization is a very unusual goal in warfare, particularly in modern times. We've gone close to 70 years of near constant warfare now without using nuclear weapons. – Aurast Dec 17 '14 at 15:09

The RPG 'Rifts' used technologies such as 'vibro-swords, vibro-daggers' and the sort. The idea was relatively simple...a blades edge could be brought to vibrate at a quick enough resonance and at an atomic scale, allowing the blade to vibrate through regular materials at an absurd rate, severing the bond of any material it was cutting through at a microscopic scale.

For weapon development, a lot of these technologies would actually descend through medical research and development...exceedingly precise incisions is always a need in a medical setting. Taking these medical innovations and powering them up to larger scales is where the weapon developers come in.

If only melee weapons were allowed, depending on how that was accomplished, I'd imagine that air superiority would become an even greater thing. Sure, you have a nice line of tanks. I can just fly over them, or drop things on them (nets, rocks, delayed explosives, chemicals, localized EMP). You're attacking me with an impregnable mech, I'll just fly into your base and take it over.

Even taking out an aircraft could be a pain. If the melee only tech was some sort of high velocity neutralizer, good luck trying to hit a jet. And without missiles of any sort, welp...

Electrostatic whip with varying degrees of lethality that can stun, wrap around and magnetically ensnare, crush, electrocute or completely sever torso's of enemy combatants at intermediate range. Think railgun whip. Can also be armour or vehicle mounted used to attach, to reel in and used in conjunction with other powered cutting devices

Reach will be key. We can easily create more lethal melee weapons, the real question would be how to deliver them to their opponent. I see people developing very long, quickly extending weapons that are almost like short-range weapons. For instance is the modern taser, which shoots out two wires that stay attached to the taser a melee weapon? can people create increasingly innovative versions of these?

of course that's for home use, the more interesting question is what the government uses. There is still no reason to arm men with your 'standard' melee weapons, people die too easily. Powered armor is generally impractical, it's easier to stick with modern tanks. Create increasingly more complexly armored tanks, with increasingly lethal attachments designed to cut through the enemies armor. Then run the two tanks into each other and see who can cut through the others armor the fastest.

Of course cutting THROUGH armor may be impractical. Maybe they will simply heat the enemy tank up enough to kill the pilots inside with heat. Maybe they will prefer faster tanks to strike slow tanks and build up electric/heat to roast the pilot inside. It really comes down to rather one can build armor or weaponry faster.

Of course the real answer is that guns will still be made and used regularly, because criminals, by definition, don't follow the law ;)

I crossed a Medieval knight's lance with my car's extending antenna and using high powered hydraulics, made it so that it can extend at high speed. Now, whenever I turn on my car's radio, I can immediately impale things 10 feet in the air. I like to take my car to the woods. If the antenna doesn't get the squirrels, the music will.

I call it the Turbo-Lance.

format: plain


text:
# Struct AffineVariationalInequalities¶

struct AffineVariationalInequalities

Structure that contains and defines an AVI.

The problem is : given a matrix $$M$$ and a vector $$q$$, find $$z$$ such that

$\langle x - z, q + Mz \rangle \geq 0 \ \text{for all }x\in K$

See users’guide for details.

Public Members

size_t size

size of the problem

NumericsMatrix *M

M matrix of the AVI (see the mathematical description)

double *q

vector of the AVI (see the mathematical description)

double *d

Covering vector (optional)

polyhedron_set poly

Polyhedra where the solution has to belong.

double *lb

Lower bounds for the variables.

double *ub

Upper bounds for the variables.

void *cones

Non-polyhedral Cones where the variable lives (not implemented yet)


text:
Blog

# Improving Angular Dirty Checking Performance

We build a lot of search applications, including our search relevancy workbench, Quepid or the US Patent and Trademarks Offices Global Patent Navigator Search. A big part of making clients happy is nailing the frontend – making search actually usable! In doing this we love Angular, but weve certainly had to guard against one performance anti-pattern – excessive dirty checking.

Angular provides convenient two-way data binding. Its an extremely convenient way of building rich templates that somehow magically seem to know to update themselves in the DOM. I can easily write some declarative HTML that expresses the content Im trying to put on the screen:

{{companyName}} Employees{{employee.fullname()}}

Instead of manually issuing a command to update a template, something magical in Angular knows somehow that the variables bound to the current $scope (in this case and ) have changed – and therefore the associated snippets of HTML need to be updated. ## The Dirty (Checking) Secret of Two-Way Binding… How does Angular magically know how to update the content? It uses a technique called dirty checking. Angular tracks the previous values for these various expressions. If it notices a change, the corresponding Angular directive is given a chance to reflect those changes in the DOM. So if employee.fullname() changes, the interpolation directive (the fancy name for the double curly-braces syntactic sugar) has a chance to reflect this change in the DOM. All of this checking happens by methods on$scope. A $scopes digest cycle runs the dirty check, evaluating expressions on$scope, checking them against previous values, and overwriting the previous values with the just calculated ones. This digest cycle is triggered by angular directives. For example, ng-click is simply a directive that binds to the corresponding elements click event. On click, the directive evaluates an expression, perhaps calling a function or perhaps doing a simple assignment. For example, maybe the click caused the variable “login” to be set to “true”. Once whatever data has been modified, the direct can then trigger the digest cycle (through $scope.$apply).

On the receiving end of the two-way binding are bits of angular code (directives or otherwise) waiting to respond to changes. This is what you see in your angularized HTML with expressions such as ng-repeat="employee in employees". Ultimately these directives register with $scope.$watch (these are the expressions being dirty checked). The job of the digest cycle is to identify all the expressions registered for watching (via $scope.watch), see if theres a change, and execute the registered callback. We might have$scope.$watch on the login flag from the previous paragraph. Our callback might update the DOM or transition to a new page. This is both Angulars secret sauce and Achilles heel. With most applications, its likely not a problem. With Quepid, however, we had a problem of repeated elements that could be clicked into. Once you were inside each element, you could interact with dozens of little widgets. From an implementation point-of-view, each of these widgets was hidden until they were clicked, something like:  ...  Unfortunately, “hidden” does not stop the dozens of little Angular widgets from registering with their scopes and being dirty-checked during the digest cycle. After enough of these repeated elements, the application would drag significantly. Using a profiler, we could clearly see the issue was in$scope.digest – Angulars digest cycle.

So what can be done to deal with this problem? Let me walk you through some of the strategies that have worked for us.

## 1. Use ng-if, not ng-show

One of the best features to come out of Angular 1.2 is ng-if. ng-show works by applying “display: none” on or off of the element – thus hiding it but keeping it in the DOM. Unfortunately, by keeping it in the DOM the directives within are still watching for change and doing work. Ng-if on the other hand delays compiling the elements into the DOM until the condition is true. Effectively this is a way to lazy-load angular capabilities into the DOM, and thus avoid having hundreds of pointless dirty checks slowing down the application.

The downside is, ng-if involves a small performance hit as it must fully compile the Angular template on-demand. This might be able to be mitigated with a combination of Ng-show and Ng-if. What if Ng-if was tied to a hover state, but paired with an Ng-click that was tied more closely to a click state?

Perhaps future versions of Angular could combine some lazy-loading functionality from ng-if with the new snazzy shadow-DOM that somehow could do part of the work without registering all the little expressions that need to watch for changes on the DOM.

## 2. Make sure what is being checked is cheap

With frequent dirty checking, its inadvisable to place calls to complex functions into Angular expressions. Remember, this stuff will get called A LOT! An ng-click somewhere could trigger a lot of dirty checking. Thus Any lengthy calculation should be avoided. For example, sorting a big list and returning the top element would probably be a big no-no. Instead, have a way to check to see if the list has changed, then take some kind of action (see #3).

## 3. For manual watches, use a single watch a version or a hash of the thing (not lots of little watches)

$scope.$watch("employee.firstName", function() {...})$scope.$watch("employee.lastName", function() {...})

Combine these into a single watch over a hash or other value that will change every time a state changes. An obvious solution is to give employee a hashing function that always returns a unique value:

Employee.Hash = function() {    return this.firstName + this.lastName + this.Age ...;}

Then elsewhere:

$scope.$watch("employee.hash", function() {});

Hash functions can collide. They might also be expensive. So lately, Ive been using a version number that increments on every change for these problems:

this.setFirstName = function(newFirstName) {    this.firstName = newFirstName    this.version++;}

Its an implementation burden, but lets me write code that just checks if a single integer has changed:

## 4. Dont use $scope.$watch for events

When you start out with Angular, its tempting to pass events up and down the $scope hierarchy by setting status at one level and performing a$watch on it elsewhere. For example in a root scope we might set:

$scope.userLogedIn = true And in child scopes, we might want to respond: $scope.\$watch("userLoggedIn", function() {});

Alternatively, dont clutter up the digest cycle with event-like expressions. Use Angulars explicit event features like emit and broadcast.

## 5. Avoid Dirty Checking Entirely by working straight with the DOM

One of my favorite things about Angular is that I reserve the right to not use Angular if need be. Even in Angular world, I can simply use a directives link function to interact directly with the DOM as needed. For example, I could chose to simply insert a handlebars template into a div instead of worrying about getting angular-ese right:

link: function(scope, element) {    button = element.find("button");    button.onClick = function() {        // find our list!        employeeList = element.find("employeeList");        employeeList.innerHtml = "No Employees, Only Ninjas!"    };};

Anyway, those techniques have helped us tremendously in our work. I hope youll also find them useful. Please comment if you have anything youd add to this list! And of course if you have problems with your search UI or would simply like a better search application, contact us to see if we can help!


text:
# Resistors

## Resistivity.

The resistance of a homogeneous conductor of constant cross section is given by:

MathML formulaFormula ImageStraight text formula
$R = ρL A$ R = ρL / A

Where

R = resistance, Ohms

L = length of conductor, meters

A = conductor cross-sectional area, meters squared

ρ = resistivity, Ohm-meters

Some values for resistivity are given below:

Material ρ (ohm-meters)
Aluminium 2.63 x 10-8
Brass 6 - 8
Carbon 3500
Constantan (Cu 60, Ni 40) 49
Copper (annealed) 1.72
Iron 10
Manganin (Cu 84, Mn 12, Ni 4) 44
Mercury 94
Nichrome 100
Silver 1.47
Tungsten 5.51
Amber 5 x 1014
Bakelite 2 x 105 - 2 x 1014
Glass 1010 - 1014
Hard rubber 1013 - 1016
Mica 1011 - 1015
Quartz 75 x 1016
Sulfur 1015
Wood 108 - 1011

## Preferred Values of Resistors.

Resistors are manufactured to a certain tolerance. The actual value of a resistor can, therefore, be within a certain range. For this reason there are 'preferred values' of resistors. The following tables show three series, the E12, E24 and E96 series. These are so named because they define respectively 12, 24 and 96 values in each decade of resistance.

 1 1.2 1.5 1.8 2.2 2.7 3.3 3.9 4.7 5.6 6.8 8.2

 1 1.1 1.2 1.3 1.5 1.6 1.8 2 2.2 2.4 2.7 3 3.3 3.6 3.9 4.3 4.7 5.1 5.6 6.2 6.8 7.6 8.2 9.1

 1 1.02 1.05 1.07 1.1 1.13 1.15 1.18 1.21 1.24 1.27 1.3 1.33 1.37 1.4 1.43 1.47 1.5 1.54 1.58 1.62 1.65 1.69 1.74 1.78 1.82 1.87 1.91 1.96 2 2.05 2.1 2.15 2.21 2.26 2.32 2.37 2.43 2.49 2.55 2.61 2.67 2.74 2.8 2.87 2.94 3.01 3.09 3.16 3.24 3.32 3.4 3.48 3.57 3.65 3.74 3.83 3.92 4.02 4.12 4.22 4.32 4.42 4.53 4.64 4.75 4.87 4.99 5.11 5.23 5.36 5.49 5.62 5.76 5.9 6.04 6.19 6.34 6.49 6.65 6.81 6.98 7.15 7.32 7.5 7.68 7.87 8.06 8.25 8.45 8.66 8.87 9.09 9.31 9.53 9.76

## Resistor Color Codes.

Colour Value Multiplier
black 0 x 1
brown 1 x 10
red 2 x 100
orange 3 x 1,000
yellow 4 x 10,000
green 5 x 100,000
blue 6 x 1,000,000
violet 7 x 10,000,000
grey 8 x 100,000,000
white 9 -


text:
## Monday, April 07, 2008

### Raghuram Rajan's Committee

#### 2 comments:

1. This comment has been removed by the author.

2. This Goldman Sachs Global Paper may be of interest to your readers.

In this report we talk about the need, potential and the reforms necessary for a vibrant Corporate Bond market in India. Many of the reforms suggested in the Raghuram Rajan's Committee report are discussed. Most importantly, this paper also posits the idea of 'low hanging fruits', i.e. focusing on smaller, less controversial reforms as opposed to big-ticket politicized reforms.

Best,
Pragyan Deb

Please note: Comments are moderated; I will delete comments that misbehave. The rules are as follows. Only civilised conversation is permitted on this blog. Criticising me is perfectly okay; uncivilised language is not. I delete any comment which is spam, has personal attacks against anyone, or uses foul language.

Please note: LaTeX mathematics works. This means that if you want to say $10 you have to say \$10.


text:
# Passing an object to the view in CodeIgniter

I'm trying to use an object and persist it into the data base.

I created a class in the library's folder.

<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');

class Solicitud {

private $categoria; private$consecutivo;
private $id; private$mensaje;
private $solicitante; function __construct(){$this->categoria = 1;
$this->consecutivo = 1;$this->mensaje = "Mensaje por defecto";
}

public function escalarSolicitud( User $actual, User$nuevo){
$this->setSolicitante($nuevo);
}

# Getters and Setters

public function setCategoria( $categoria ){$this->categoria = $categoria; } public function getCategoria(){ return$this->categoria;
}

Here is the Controller:

<?php

if (!defined('BASEPATH')) exit('No direct script access allowed');

function __construct(){
parent::__construct();
}

public function crearSolicitud(){

$session_data =$this->session->userdata('session_user');
$usuario =$session_data['usuario'];
$categoria =$this->input->post('category');
$mensaje =$this->input->post('description');

$solicitud = new solicitud;$solicitud->setSolicitante($user);$solicitud->setCategoria($categoria);$solicitud->setMensaje($mensaje);$this->helpdesk_model->createSupport( $solicitud ); }  And in the Model how can I use the object properties: public function createSupport($soporte ){

$this->db->trans_start();$data = array(
'id' => null,
'id_user' => $soporte[usuario], ??? 'id_category' =>$soporte[categoria], ???
'message' => $soporte[mensaje] ??? );$this->db->insert('supports', $data);$this->db->trans_complete();

return $this->db->trans_status(); }  I need to know if I'm in the right direction or if the use of the 'Solicitud' class is not necessary. If I'm right, how should I call in the model the object attributes? • I realized that int the model I can use the get functions like 'id_category' =>$soporte->getCategoria(); Feb 5, 2014 at 14:51
• yep in your case since you don't modify anything with the data i would pass them just as an array Apr 7, 2014 at 12:04

I would like to add something to @Dukeatcoding comment in the question. What is the point of passing the whole object? Thinking on it as a part of the main controller, you should only pass the data as an array to the model:

$data = array( 'id_user' =>$usuario,
'id_category' => $soporte->getCategoria 'message' =>$soporte->getMensaje
)
$this->helpdesk_model->createSupport($solicitud );

Although, as you are getting all these properties so often, what about a general getter in your soporte class?

public function getValue( $var ){ return$this->{$var}; }  And you'd have something like: $data = array(
'id_user'     => $soporte->getVar( 'usuario'), 'id_category' =>$soporte->getVar( 'categoria'),
'message'     => $soporte->getVar( 'mensaje' ) )  From your code, I would take care of the validation of your values, as it looks like you don't validate if they're numeric, if they exists on your DDBB, etc. Maybe you're doing it, because I suppose the code you posted is just a excerpt (due to some method are missed in Solicitud, as setSolicitante($nuevo) ), but I prefer to write it, just in case.

Also, I won't assign to a var the values you take directly, just call them an take the value:

//Instead of:
$session_data =$this->session->userdata('session_user');
$usuario =$session_data['usuario'];
// Better
$usuario =$this->session->userdata('session_user');

Off topic, you could check Doctrine, http://www.doctrine-project.org/projects/orm.html, is an ORM that maybe could help you, and it has its own CI recipe: http://docs.doctrine-project.org/en/2.0.x/cookbook/integrating-with-codeigniter.html

Have fun!


text:
## Recommended Posts

Hi I'm currently reading the book more OpenGL game programming. I have some basic questions about the shaders which haven't been discussed in that book. We know that the equation for OpenGL matrices is: Projection matrix * View matrix * Model matrix * local vertex position = final vertex position; So when a vertex shader is applied to a vertex?For example before all these matrices are applied in a program? Another question is that what's the meaning of "fragment" in a fragment shader? Is it simply a pixel or is it a triangle for example? When it is applied to a program? ( before and after stages in a fragment processing ) Thanks

##### Share on other sites
A vertex shader typically takes a vertex's local coordinates and any model/view/projection matrices and applies the matrices to the vertex, and then emits the projection space coordinates. You don't typically apply these matrices in your program, although you can concatenate the model, view, and projection matrices in the program to reduce the number of operations in the vertex shader.

A fragment is a pixel (or texel). Once all of the vertices of a primitive are transformed through the vertex shader, the primitive is rasterized, and each pixel is sent to fragment shader for coloring. The fragment shader emits a color for the pixel, which is then written into the framebuffer or whatever target you are rendering to.

##### Share on other sites
I have still problem with fragment shader :(
The subject is complex and I need to know what stages are involved in the rasterization process .
Assuming that we have 2 triangles and one of them is in front of the other, What stages are involved in the raster level?For example, does it convert the first triangle to 40 pixels and the second one to 60 pixels ?(values are just optional for my example) We know that z buffer is done after fragment shader, so I guess these triangles are still available after raster level?Does fragment shader process all the primitives at once and send them to the fragment shader or does it converts each primitive( for example that triangle) to pixels and sends it to the fragment shader, then processes the next one and sends it to the fragment shader, etc ?
Assuming that a triangle consists of 40 pixels after raster level, does it mean that the fragment shader processes all these 40 pixels?

##### Share on other sites
Quote:
 We know that z buffer is done after fragment shader, so I guess these triangles are still available after raster level?

After rasterization the original primitives are gone. The z-buffer has a value for each pixel and is compared per-pixel, not per triangle.

Quote:
 Does fragment (do you mean vertex?) shader process all the primitives at once and send them to the fragment shader or does it converts each primitive( for example that triangle) to pixels and sends it to the fragment shader, then processes the next one and sends it to the fragment shader, etc ?

I would imagine that the GPU does not wait for every primitive to be rasterized before sending them to the fragment shader, its just a pipeline and they are processed as soon as they are available. Keep in mind there is not just one "vertex or fragment shader" in the GPU, there are hundreds that are cranking out pixels in parallel. I think your question is implementation dependent, and I can't imagine any good reason why you would want to have this information. If you would elaborate on what your problem is maybe someone could help you.

The OpenGL Machine

Unfortunately it is only from version 1.1, I could not find a digital copy of the most recent one. I have a physical copy of the version 3.1 machine, and the operations after the Fragment shader look pretty similar.

If you're talking about fragment shaders, just imagine a box around the Texel Generation, Texture Application, and Fog components. This represents what is now the fragment shader. Everything after fragment shader starting with "Coverage (antialiasing) Application" looks pretty much the same as the 3.1 poster.

##### Share on other sites
OK,
1)What about the varying variables? Assuming that we have only 3 vertexes and compute a varying variable for each vertex, how does a fragment shader understand that which varying variable must be used for which fragment?We have only 3 vertices, but the rasterization may generate multiple pixels.
2)When the output of the vertex shader is sent to the fragment shader?For example when it processes a primitive of type "type" given by glBegin(type)?

##### Share on other sites
Quote:
 1)What about the varying variables? Assuming that we have only 3 vertexes and compute a varying variable for each vertex, how does a fragment shader understand that which varying variable must be used for which fragment?We have only 3 vertices, but the rasterization may generate multiple pixels.

These are interpolated across the triangle. If one vertex has a varying value of zero, and another has a value of 1, then the pixels between those vertices will be in the range from zero to one.

Quote:
 2)When the output of the vertex shader is sent to the fragment shader?When it processes 3 vertexes that creates a triangle?

The vertices must go through primitive assembly before being rasterized, so you would need to wait at least until all vertices of a primitive are through the vertex shader.

##### Share on other sites
So when we use per fragment lighting, each fragment deals with its own interpolated varying variables. Here I have another question. If the fixed function is able to interpolate the color values of vertexes and send them to fragments, why do we need to specify color for a fragment inside a fragment shader? Just to change the behavior of the fixed function color interpolation?

## Create an account

Register a new account

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627667
• Total Posts
2978532
• ### Similar Content

• Both functions are available since 3.0, and I'm currently using glMapBuffer(), which works fine.
But, I was wondering if anyone has experienced advantage in using glMapBufferRange(), which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
• By xhcao
Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness.
• By cebugdev
hi guys,
are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic
let me know if you guys have recommendations.
• By dud3
How do we rotate the camera around x axis 360 degrees, without having the strange effect as in my video below?
Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.
Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.

References:
Code: https://pastebin.com/Hcshj3FQ
The video shows the difference between blender and my rotation:

• By Defend
I've had a Google around for this but haven't yet found some solid advice. There is a lot of "it depends", but I'm not sure on what.
My question is what's a good rule of thumb to follow when it comes to creating/using VBOs & VAOs? As in, when should I use multiple or when should I not? My understanding so far is that if I need a new VBO, then I need a new VAO. So when it comes to rendering multiple objects I can either:
* make lots of VAO/VBO pairs and flip through them to render different objects, or
* make one big VBO and jump around its memory to render different objects.
I also understand that if I need to render objects with different vertex attributes, then a new VAO is necessary in this case.
If that "it depends" really is quite variable, what's best for a beginner with OpenGL, assuming that better approaches can be learnt later with better understanding?

• 10
• 10
• 12
• 22
• 13


text:
# Questions about proof of intermediate value theorem

by Dimen   Last Updated June 30, 2020 02:20 AM

I was reading the proof of intermediate value theorem: https://en.wikipedia.org/wiki/Intermediate_value_theorem#Proof
But I cannot understand the last sentence of the statement below.

Define $$S = \lbrace x \in [a, b] \; | \; f(x) \leq u \rbrace$$ and $$c$$ as the supremum of $$S$$. Choose some $$\epsilon$$. By continuity, there exists $$\delta$$ such that $$|f(x) - f(c)| < \epsilon$$. By the properties of the supremum, we can chose some $$a^*$$ from $$(c - \delta, c)$$ such that $$a^* \in S$$.

Suppose that the function looks like below and we choose $$u$$ as indicated on the axis. The set $$S$$ is colored in blue. In this case, $$c$$ is an isolated point and thus, we cannot guarantee the existence of $$a^*$$ within $$\delta$$-neighborhood of $$c$$.

Clearly I have misunderstood about something, but where did I get wrong?

Tags :


text:
Thursday, December 11, 2014

Hugo Krawczyk opened the final day presenting a paper on password-protected secret sharing. He began with a motivating example of protecting a high value secret such as a Bitcoin wallet. Typical storage methods using password authentication at a server are vulnerable to a single point of failure - an attacker just needs to break into one server, and can then mount an offline dictionary attack to guess the user's password and recover the key. One natural cryptographic solution to this problem is to secret share the wallet key across multiple servers (this approach is taken in the commercial solution offered by Dyadic Security), ensuring that an attacker must break into several servers to recover the key. The problem now is that in order to use the Bitcoin wallet, you must authenticate yourself to each of your servers - if this is done with a single password then there are now many points of failure for the system! An offline dictionary attack can now be performed against any one of the servers. Of course, one could choose different, strong passwords for each server, but this is unlikely to be practical for most users.

The notion of password-protected secret sharing (PPSS) gets around this. A PPSS scheme allows a user to secret share a secret among n servers (with threshold t) and store just a single password for authentication. Roughly speaking, the security guarantee is that any attacker breaking into up to t servers and obtaining all of their secret information (shares, long-term keys, password files etc) cannot learn anything about the secret or the password. This implies that the adversary's only hope is to try and guess the password in an online attack: offline attacks with fewer than t+1 servers are useless.

The main contribution of the paper is a new PPSS scheme, which only requires authenticated channels between the servers (except for a one-time setup phase) and is very efficient: authentication is done in one round of communication (2 messages), requiring 2t + 3 exponentiations for the client and 2 for each server. Previous schemes were much less efficient and often required additional assumptions such as a PKI.

The main building block of their construction is an Oblivious PRF (OPRF). Here a server holds a PRF key $k$, the user holds the input $x$ and obtains the output $f_k(x)$, whilst the server learns nothing about the input. This can be done very efficiently with a 'hashed Diffie-Hellman' technique, where the output is defined by $f_k (x) = H(H(x)^k)$ and can be computed with a standard DH exchange requiring just 2 exponentiations per party.

For the PPSS scheme, each server $S_i$ has an OPRF key $k_i$. The user chooses a password $p$, secret shares their secret $s$ into shares $s_i$ and runs the OPRF with each server to obtain $r_i = f_{k_i}(p)$. They then encrypt $s_i$ as $c_i = s_i \oplus r_i$, store $c_i$ at server $S_i$, erase all intermediate information and store the password $p$. To reconstruct, the user retrieves $c_i$ from $S_i$ and runs the OPRF to recover the shares $s_i$. The protocol is nice and simple to describe, but there are many subtle issues that arise with defining and proving security for the OPRF used in the construction: see the paper for details.

Another application of PPSS is for threshold PAKE (password authenticated key exchange), which allows a user to securely exchange keys with any subset of n servers using a single password, provided no more than t servers are corrupted.  They prove a generic composition theorem showing that PPSS can be combined with key exchange to give threshold PAKE in just one round, which was never achieved by any prior work.


text:
# I'm confused by this problem. Is the answer 1 or 0 OR 1/2? If the

I'm confused by this problem. Is the answer 1 or 0 OR 1/2? If the series is upto n, then the answer is 1 if the number is odd and 0 if even. If you assume that the answer is x, then 1-x = x and the answer is 1/2. Is the answer 1 or 0 OR 1/2? or simply indeterminate?

dextercioby
Homework Helper

In mathematics such a series is called conditionally convergent. It means that it matters in which order you are summing its terms. You can write your series in 3 different ways that eventually lead to 3 different answers, 0,1,1/2.

disregardthat

No, the value of this series does not depend on the order of the terms, but on the terms themselves. What is each term? Is it 1,-1,1,-1,... ? In that case it diverges. Is it 1-1,1-1,1-1,... i.e. 0,0,0,0,..? In that case it converges. Any other definition of the terms?

The order of the terms 1,-1,1,-1,... doesn't matter in an infinite series, it will diverge anyway in that case.

Hi saratchandra, welcome to PF!

You have already recognized that you have a series. Can you write down the series with a summation sign? And how can you check whether a series is convergent or divergent?

D H
Staff Emeritus

If you assume that the answer is x, then 1-x = x and the answer is 1/2.
To demonstrate what saratchandra is talking about, let S be the value of this series,

$$S=\sum_{r=0}^{\infty} (-1)^r$$
Then if S exists, we can compute 1-S by adding 1 and the additive inverse of S:

$$1-S=1-\sum_{r=0}^{\infty} (-1)^r = 1+\sum_{r=0}^{\infty} (-1)(-1)^r = 1+\sum_{r=1}^{\infty}(-1)^r = \sum_{r=0}^{\infty} (-1)^r = S$$
or 1-S=S, yielding S=1/2. This is of course illegal; just because an operation is valid when applied to a convergent series does not mean it can be applied to a divergent series. However, this value of 1/2 appears in many other forms when evaluating this series. For example,

$$\frac 1{1+x} = \sum_{r=0}^{\infty} (-1)^rx^r$$
Evaluating this at x=1 yields

$$\frac 1{1+1} = 1/2 = \sum_{r=0}^{\infty} (-1)^r$$
Hah! 1-1+1-1+... = 1/2! Yet another place this series arises is in the eta function,

$$\eta(z) = \sum_{r=1}^{\infty} \frac{(-1)^{r+1}}{r^z}$$
At z=0, this becomes

$$\eta(z) = 1/2 = \sum_{r=0}^{\infty} (-1)^r$$
So once again, 1-1+1-1+... = 1/2. Another way to look at the eta function is via its relation to the zeta function,

$$\eta(z) = (1-2^{1-z})\zeta(z)$$
Thus $\eta(0) = -\zeta(0)$. The series representation of the zeta function is

$$\zeta(z) = \sum \sum_{r=1}^{\infty} \frac{1}{r^z}$$
Evaluating this series at z=0 yields

$$\zeta(0) = -1/2 = 1+1+1+1+\cdots$$
This shows how the series 1-1+1-1+... is related to the series 1+1+1+1+..., which every physicist knows has a value -1/2 (zeta function renormalization).

Some very nasty tricks were employed here, several of them illegal. On the other hand, analytic continuity is a very legal operation, and this was used underneath the hood to find several of these evaluations. Several divergent series can indeed take on well-defined, consistent values when analyzed in the context of analytic continuity.

Last edited:

Thanks a lot DH for the detailed explanation. Thanks to others too

Last edited:

This is of course illegal; just because an operation is valid when applied to a convergent series does not mean it can be applied to a divergent series. However, this value of 1/2 appears in many other forms when evaluating this series. For example,

$$\frac 1{1+x} = \sum_{r=0}^{\infty} (-1)^rx^r$$
Evaluating this at x=1 yields

$$\frac 1{1+1} = 1/2 = \sum_{r=0}^{\infty} (-1)^r$$
Hah! 1-1+1-1+... = 1/2!
That is illegal yet as well. The geometric progression works only if 0<x<1. As it appears that there is no legal way to prove this, would it not be better to say the sum is undefined?

disregardthat

That is illegal yet as well. The geometric progression works only if 0<x<1. As it appears that there is no legal way to prove this, would it not be better to say the sum is undefined?
What do you mean by better? The sum does $$\sum^{\infty}_{n=0} x^{n}$$ not exist as a limit of partial sums for x = -1, but one can extend the domain of definition as one please. In this particular extension (which is the unique analytical extension to C-{1} I believe), we will have that it equals 1/2.

I meant "safer". Anyway, so what you mean is we define the sum to be 1/2 because it "extends" properly from previous know formulae? Like how we define 0! = 1, even though the factorial definition is for positive integers only?

disregardthat

I meant "safer". Anyway, so what you mean is we define the sum to be 1/2 because it "extends" properly from previous know formulae? Like how we define 0! = 1, even though the factorial definition is for positive integers only?
Yes, exactly like how we define 0! = 1, even though the recursive definition of n! as n! = n*(n-1)! and 1! = 1 only applies to n>0.

In this case however the extension is less "arbitrary", in the sense that there is only one analytical extension of the function 1/(1-x) (on the open ball of radius 1 in C) to C-{1}. In other words it is only one particular way of extending the function to C-{1} while preserving differentiability (as a complex function).

No, the value of this series does not depend on the order of the terms, but on the terms themselves.
I am not an expert, pardon me if I venture a layman opinion: the value of the series depends on the number of terms:
if it is even = 0, if it's odd = 1
infinity is even or odd?

D H
Staff Emeritus

By almost all the techniques taught in lower level math classes (sophomore college and below) to test for whether a series is convergent, series such as 1-1+1-1+... , 1+1+1+1+..., 1+2+3+4+..., etc. fail to converge. All of them fail the simplest test of all: the terms that comprise the series do not converge to zero.

So you can stop right there and say these series are divergent, they have no value -- or you can go to more advanced techniques. There are a variety of ways to give meaning to divergent series. Cesàro summation, Abel summation, Borel summation, ... You do have to give some things up along the way. For example, order doesn't matter in an absolutely convergent series. Order does matter with these divergent series. Take Grandi's series, 1-1+1-1+... Swap adjacent even (2n) and odd(2n+1) terms and you get -1+1-1+1... Per those more advanced techniques, this is a different series, one whose value is -1/2.

Yet another technique is that of analytic continuation. Suppose some function f(z) has a series representation f(z)=Ʃanϕn(z) for z within some domain (e.g., a radius of convergence r about some point z0). Suppose the function f(z) has an analytic continuation outside of that domain. Because the analytic continuation of a function (if it exists) is unique, it makes a lot of sense to say that the value of the series at some point outside the radius of convergence of the series is the value of the analytic continuation of the series at that point.

If you accept that 1 - 1 + 1 - 1 + ... = 1/2, then you also have to accept that

1 - 2 + 3 - 4 + ... = 1/4

Proof:
Look at the series:
$$S(x) = \sum_{n = 1}^{\infty}{x^{n}}$$
and find its derivative:
$$S'(x) = \sum_{n = 1}^{\infty}{n x^{n - 1}}$$
So, our series in question is $S'(-1)$. But, if you look at $S(x)$, it is actually a geometric series with a sum:
$$S(x) = \frac{1}{1 - x}$$
Although the sum itself is strictly convergent for $|x| < 1$, this rational expression is defined for all $x \neq 1$ (We say that the rational expression is an analytic continuation of the function defined in the unit circle by the convergent series). Then, take the derivative:
$$S'(x) = \frac{1}{(1 - x)^2}$$
and you get $S'(-1) = 1/4$. This method is called Abel summation.

Notice that the above formulas fail for $x = 1$, i.e. you cannot say anything about, for example, the series

1 + 1 + ...

and

1 + 2 + ...

Last edited by a moderator:
disregardthat

I am not an expert, pardon me if I venture a layman opinion: the value of the series depends on the number of terms:
if it is even = 0, if it's odd = 1
infinity is even or odd?
The value of an infinite series is the limit of the sequence of partial sums (which are both even and odd). As you say, they alternate between 0 and 1, and so will not converge at all.

Infinity is not an integer, it's not even nor odd.

. As you say, they alternate between 0 and 1, and so will not converge at all. Infinity is not an integer, it's not even nor odd.
I was joking, disregard that, that's what I meant: not convergent, not divergent, alternating: 0/1 , value could be either 0 or 1. Beyond technicalities the bottom line is: value is not decidable

Last edited:

Is there anything wrong with saying that the sum of the sequence 1,-1,1,-1,... converges to the two values 0 and 1? i.e. a multi-valued or double peak convergence.

If we put our foot down and just say 'undefined' or 'undecidable' then we seem to be missing out on informing people about the limit. For instance, what does eix converge to as x tends to +infinity? Would it not be better to say that it converges to the set of points on the unit circle than to just say it is undecidable.

disregardthat

Is there anything wrong with saying that the sum of the sequence 1,-1,1,-1,... converges to the two values 0 and 1? i.e. a multi-valued or double peak convergence.

If we put our foot down and just say 'undefined' or 'undecidable' then we seem to be missing out on informing people about the limit. For instance, what does eix converge to as x tends to +infinity? Would it not be better to say that it converges to the set of points on the unit circle than to just say it is undecidable.
Well, you can say that 1 and 0 are the only values for which a subsequence of the partial sums can converge to. As you mention as well, the suplim and inflim of the sequence of partial sums converge to 1 and 0 respectively.

But there is no mis-information about saying that the series diverges. In fact it is instructive to say so, because I think many people might think of diverging series exclusively as unbounded series, or even series that grows indefinitly.

As you say, they alternate between 0 and 1, and so will not converge at all..
As I said, I am considering the problem from a logical point of view: if argument is valid to prove it does not converge, should be valid to prove it does not diverge. A swindle to prove this has not yet been presented, but it is possible. The concept of convergence/divergence implies "change" of value, direction: here values do not change at all, start 0/1 and stay 0/1 at infinity. Definition, rules should allow exceptions for cases like Grandi: no convergence , no divergence, no Cesaro sum. Just a layman opinion.

disregardthat

As I said, I am considering the problem from a logical point of view: if argument is valid to prove it does not converge, should be valid to prove it does not diverge. A swindle to prove this has not yet been presented, but it is possible. The concept of convergence/divergence implies "change" of value, direction: here values do not change at all, start 0/1 and stay 0/1 at infinity. Definition, rules should allow exceptions for cases like Grandi: no convergence , no divergence, no Cesaro sum. Just a layman opinion.
I couldn't make any sense of what you are talking about here. The fact of the matter is that the series does not converge.

D H
Staff Emeritus

As I said, I am considering the problem from a logical point of view: if argument is valid to prove it does not converge, should be valid to prove it does not diverge. A swindle to prove this has not yet been presented, but it is possible. The concept of convergence/divergence implies "change" of value, direction: here values do not change at all, start 0/1 and stay 0/1 at infinity. Definition, rules should allow exceptions for cases like Grandi: no convergence , no divergence, no Cesaro sum. Just a layman opinion.
What swindle?

Convergence and divergence are flip sides of the same freshman calculus coin. Analyzing a series from the perspective of the convergence/divergence of the sequence of partial sums is but one way to try to assign a value to that series. The best way to interpret "divergence" is that these elementary techniques are not powerful enough assign a value to the series in question. Other techniques can assign a value. Any two techniques that are regular and linear that do assign some value to some series will agree with one another.

This is just one of many cases where the simple techniques taught in freshman/sophomore mathematics are not up to some task. Another example is integration. Consider the indicator function, IQ(x) = 1 if x is rational, 0 if x is irrational. What is the integral of this function from x=0 to x=1?

What swindle??
Eilenberg-Mazur

256bits
Gold Member

This may be elementary but why can't it be solved this way:

S=∑r=0∞(−1)r
S = 1 - 1 + 1 - 1 + 1 - 1 + . . .

S = 0 + 1 - 1 + 1 - 1 + 1 - 1 + . . .

2S = 1

S = 1/2

disregardthat

This may be elementary but why can't it be solved this way:

S = 1 - 1 + 1 - 1 + 1 - 1 + . . .

S = 0 + 1 - 1 + 1 - 1 + 1 - 1 + . . .

2S = 1

S = 1/2
It doesn't work because there is not such S. In other words, it's nonsensical (in the sense of adding an infinite series with another).

256bits
Gold Member

It doesn't work because there is not such S. In other words, it's nonsensical (in the sense of adding an infinite series with another).
Reason I asked is that is how some of the proofs in highschool math were formulated.
Can't remeber if they were divergent or convergent series.

disregardthat


text:
#### Vol. 1, No. 1, 2008

 Recent Issues
 The Journal About the Journal Editorial Board Editors’ Interests Subscriptions Submission Guidelines Submission Form Policies for Authors Ethics Statement ISSN: 1948-206X (e-only) ISSN: 2157-5045 (print) Author Index To Appear Other MSP Journals
Vanishing viscosity plane parallel channel flow and related singular perturbation problems

### Anna Mazzucato and Michael Taylor

Vol. 1 (2008), No. 1, 35–93
##### Abstract

We study a special class of solutions to the three-dimensional Navier–Stokes equations ${\partial }_{t}{u}^{\nu }+{\nabla }_{{u}^{\nu }}{u}^{\nu }+\nabla {p}^{\nu }=\nu \Delta {u}^{\nu }$, with no-slip boundary condition, on a domain of the form $\Omega =\left\{\left(x,y,z\right):0\le z\le 1\right\}$, dealing with velocity fields of the form ${u}^{\nu }\left(t,x,y,z\right)=\left({v}^{\nu }\left(t,z\right),{w}^{\nu }\left(t,x,z\right),0\right)$, describing plane-parallel channel flows. We establish results on convergence ${u}^{\nu }\to {u}^{0}$ as $\nu \to 0$, where ${u}^{0}$ solves the associated Euler equations. These results go well beyond previously established ${L}^{2}$-norm convergence, and provide a much more detailed picture of the nature of this convergence. Carrying out this analysis also leads naturally to consideration of related singular perturbation problems on bounded domains.

##### Keywords
Navier–Stokes equations, viscosity, boundary layer, singular perturbation
##### Mathematical Subject Classification 2000
Primary: 35B25, 35K20, 35Q30


text:
# Does the rejection of the null hypothesis have anything to do with Popper’s theory of falsification?

According to Popper, we cannot verify a hypothesis due to the problem of induction – we can only aim to falsify it. If we are repeatedly unable to falsify it, the hypothesis is said to be tentatively accepted. For Popper, all science shall come up with hypotheses and try to falsify them as hard as possible.

In some introductions to statistical hypothesis testing, I could read that scientists aim to falsify the null hypothesis and that this somehow is in accordance with Popper’s theory of falsification. Here is a posting, stating this view. (User @Stefan did comment this posting, making exactly my point.)

I have three questions:

1. Doesn’t Popper say we should try to falsify the alternative hypothesis?
2. Does falsifying the null hypothesis count as failed falsification of the alternative hypothesis?
3. Might be some semantic sophistry: Shouldn’t scientists try to corroborate the null hypothesis instead of trying to falsify it?

(If this posting should be in the “philosophy”-board, please move it there…)

I was also going to point to Deborah Mayo’s work as linked in a comment. She is a Popper influenced philosopher who has written a lot about statistical testing.

I’ll try to address the questions.

(1a) Popper didn’t think of statistical testing as formalising his approach at all. Mayo states that this is because Popper was not expert enough in statistics, but also he probably wouldn’t have allowed for an error probability of 5% or 1% as “falsification” (Mayo may also have mentioned this somewhere, but I don’t remember).

(1b) There are different approaches for picking the null and alternative hypothesis. In some applications, the null hypothesis is a precise scientific theory of interest, and we check whether the data falsify it. This would be in line with Popper (at least if he allowed for nonzero error probabilities). In some other approaches (in many areas this is found much more often), the null hypothesis formalises the idea that “nothing meaningful is going on”, and the alternative is of actual scientific interest. This would not be in line with Popper. (Also, the alternative is not normally specified precisely enough to imply conditions for falsification, and be it statistical.)

(2) According to the standard logic of statistical tests, the null hypothesis can be statistically (i.e. with error probability) falsified, but not the alternative. There is a possibility to argue that an alternative is statistically falisfied, but this basically amounts to running tests the other way round. For example, if you have a $$H0: μ=0H_0:\ \mu=0$$ and an alternative $$μ≠0\mu\neq 0$$, you cannot falsify the alternative (as it allows for $$μ\mu$$ arbitrarily close to 0, which cannot be distinguished by data from $$μ=0\mu=0$$), but you could state that a meaningful deviation from $$μ=0\mu=0$$ would actually be $$|μ|≥2|\mu|\ge 2$$, and in this case you may reject $$|μ|≥2|\mu|\ge 2$$ in case $$ˉx\bar x$$ is very close to zero. This makes sense if the power of the original test for $$|μ|≥2|\mu|\ge 2$$ is large enough that in that case “$$ˉx\bar x$$ close to zero” would be very unlikely. (This is related to Mayo’s concept of “severity”; in such a case we can say that $$|μ|<2|\mu|<2$$ "with severity".) We could also then say that we have "statistically falsified" $$|μ|≥2|\mu|\ge 2$$.

(3) This is indeed a philosophical question, and I have seen arguments in either direction.


text:
RUS  ENG JOURNALS   PEOPLE   ORGANISATIONS   CONFERENCES   SEMINARS   VIDEO LIBRARY   PERSONAL OFFICE
 General information Latest issue Archive Impact factor Search papers Search references RSS Latest issue Current issues Archive issues What is RSS

 Izv. Vyssh. Uchebn. Zaved. Mat.: Year: Volume: Issue: Page: Find

 Periodic varieties of associative ringsM. V. Volkov 3 Estimates of the norm of a function of a Hilbert–Schmidt operatorM. I. Gil' 14 Exact values of best one-sided approximations of certain classes of periodic functionsV. G. Doronin, A. A. Ligun 20 Exponentiation of permutation groups. IL. A. Kaluzhnin, M. Kh. Klin, V. I. Sushchanskii 26 The method of linearized residuals for accelerating the convergence of an iteration methodV. A. Kurchatov 34 An inverse boundary value problem for domains that are holomorphically equivalent to the bidiscN. N. Piven' 45 The analogue of a theorem of A. Zygmund for Legendre polynomialsS. Z. Rafal'son 54 Membership of the sum of a cosine series with monotone coefficients in a symmetric spaceV. A. Rodin 60 An iteration method for solving a convex programming problem with an infinite system of constraintsT. A. Tarasova 65 On the error of uniform approximation of functions of two variables by a sum of functions of one variableV. N. Trofimov, L. R. Khariton 70 Stability of stochastic difference systemsG. S. Yudaev 74 Brief communications A bifamily of planes in $A_n$A. V. Britov 79 The method of mechanical quadratures for singular integral equationsV. I. Kas'yanov 82 An equation of convolution type and singular integral equations in the exceptional caseV. S. Rogozhin, T. N. Radchenko 87 Semigroups of endomorphisms of ordered sets, complete with respect to divisionÈ. G. Shutov 93


text:
# tf.clip_by_value

tf.clip_by_value(
t,
clip_value_min,
clip_value_max,
name=None
)

Defined in tensorflow/python/ops/clip_ops.py.

See the guide: Training > Gradient Clipping

Clips tensor values to a specified min and max.

Given a tensor t, this operation returns a tensor of the same type and shape as t with its values clipped to clip_value_min and clip_value_max. Any values less than clip_value_min are set to clip_value_min. Any values greater than clip_value_max are set to clip_value_max.

#### Args:

• t: A Tensor.
• clip_value_min: A 0-D (scalar) Tensor, or a Tensor with the same shape as t. The minimum value to clip by.
• clip_value_max: A 0-D (scalar) Tensor, or a Tensor with the same shape as t. The maximum value to clip by.
• name: A name for the operation (optional).

#### Returns:

A clipped Tensor.

#### Raises:

• ValueError: if the clip tensors would trigger array broadcasting that would make the returned tensor larger than the input.


text:
# Question

A random sample of 100 women from the General Social Survey showed that the mean number of children reported was 1.85 with a standard deviation of 1.5. (Interestingly, a sample of 100 men showed a mean of 1.49 children.)
a. Find a 95% confidence interval for the population mean number of children for women. Because the sample size is so large, you can use 1.96 for the critical value of t (which is the same as the critical value of z) if you do the calculations manually.
b. Find a 90% confidence interval. Use 1.645 for the critical value of t, which is the critical value of z.
c. Which interval is wider, and why?

Sales0
Views18


text:
### M10 – Chuck Or Rotary Table Clamp On

This command turns On the Chuck Clamp output.

CAUTION: For safety, output LOW means the clamp is On and an interlock signal from the spindle drive must be wired for safety so that the clamp does not open while the spindle/chuck is spinning.

• M10

# Example program

N10 M10

In this example the Chuck Clamp is switched On.


text:
# [OS X TeX] Size of braces and parentheses in split environment

Axel E. Retif axel.retif at mac.com
Mon Aug 18 03:15:21 EDT 2008

On  17 Aug, 2008, at 16:49, R Martinez wrote:

> All,
>
> The following display equation using a split environment produces
> curly braces and parentheses of different sizes in each line of the
> expression. I would like both lines to have braces and parentheses
> that have the same size as those in the first line.
>
>
>
> \begin{split}
> 	K_z  &= \frac{1}{\left( \sigma_{x}^{2} + \sigma_{y}^{2}\right)^{2}}
> \: \left(\mathcal{E} \left\{\left( X- \eta_x \right)^4 \right\} +
> \mathcal{E} \left\{\left( Y- \eta_y \right)^4 \right\} \right. \\
> \right)^2 \left( Y- \eta_y \right)^2 \right\}  \right)
> \end{split}
>

I see them equal in both lines, but you will have to tell us which
class, size and font package you're using, as there is a huge
difference, for example, in the relative size of delimiters between
article class at 12pt or 10pt:

\documentclass[12pt]{article} % <- change this to 10pt and see the
difference
\usepackage{amsmath}
\usepackage[T1]{fontenc}
\begin{document}

Now load the Latin Modern fonts: \usepackage{lmodern} and you will not
see that difference in the relative sizes of delimiters between 10pt
and 12pt.

Now load TXfonts: \usepackage{txfonts}, and you'll see \left( X-
\eta_x \right)^2 is not equal to \left( Y- \eta_y \right)^2.

I think the best for you is to set the sizes yourself: see page 56 of

http://www.ctan.org/get/info/lshort/english/lshort.pdf

and especially section 8 of

http://www.ctan.org/get/info/math/voss/mathmode/Mathmode.pdf

Best,

Axel