text:
# Introduction

Connect Four is a game where you attempt to get four in a row: horizontally, vertically, or diagonally. In this code golf, we will be trying to find who won, given a game board. There will always be one winner, and only one winner.

Given a Connect Four board, figure out who the winner is: X or Y. There will always be one winner, and only one winner. The board size will always be 6 by 7 like how the game board is in the in picture.

Given a board the following board, in this instance, X is red and Y is blue:

OOOOOOO
OOOOOOO
OOOOOOO
OOOOXOO
OOOXXOO
OOXYYYY

You can separate rows of the game by newline character (like above), no dividing character, divide the rows into an array or list, or you can input a matrix of characters.

Correct output for this example:

Y

Y has four in a row; so, Y is the winner. So, we output Y.

# Test cases

Input:

OOOOOOO
OOOOOOO
OOOOOOO
OOOOOOO
OOYYOOO
OYXXXXO

Output:

X

Input:

OOOOOOO
OOOOOOO
OOOOOOO
XXXXOOO
YXYYOOO
YXYYXYX

Output:

X

Input:

YXYYXOO
XYXXYOO
XXXYYOO
YYYXXOO
XXYYYYO
XXYYXXO

Output:

Y

Input:

OOOOOOO
OOOOOOO
OYOOOOO
OOYOOOO
OOOYOOO
OOOOYOO

Output:

Y

Input:

OOOOOOO
OOOOOOO
OYOOOOX
OOYOOOX
OOOXOOX
OXOXYOX

Output:

X

# Scoring

Least number of bytes wins!

• This is the perfect challenge for PMA/Snails codegolf.stackexchange.com/questions/47311/… Apr 21, 2017 at 1:21
• Can we assume that the winner will always have one more token than the loser? Apr 21, 2017 at 2:38
• @mathjunkie I was wrong, you can't assume that.
– Neil
Apr 21, 2017 at 2:44
• @nfnneil does the output have to be X or Y or can we choose two other consistent outputs to indicate the winner? Apr 21, 2017 at 5:51
• Can we choose to use other characters as input? Or to input a numeric matrix? Apr 21, 2017 at 7:42

# Retina, 51 48 bytes

Thanks to Martin Ender for saving 3 bytes

MX((.{6}X){3}|(.{8}X){3}|(.{7}X){3}|XXX)
TdYX

Try it Online!

Takes input as a comma-separated list of rows

• You can save a few bytes by using a match stage and shortening (.{7}X){3}|XXX to (.{7}X|X)\4\4: tio.run/nexus/retina#fc4xCsMwDAXQPfcI2GC6NDS5QaeipcP/… Apr 21, 2017 at 5:57
• @MartinEnder I don't see how you can use \4 - you want to repeat the effect of the .{7}, not the matched string. (And balancing groups would probably be far too long.)
– Neil
Apr 21, 2017 at 7:59
• @Neil oh yeah, nevermind, somehow I didn't consider that there are other OXY cells than the match in the grid. using the match stage still saves 3 bytes then. Apr 21, 2017 at 8:00

# Javascript (ES6), 54 55

Edit 1 byte saved thanks @Arnauld

I just check if X is the winner, as There will always be one winner, and only one winner

Input is a string with any separator, like in @Arnauld's answer

F=
b=>'YX'[+[0,6,7,8].some(x=>b.match(X(.{${x}}X){3}))] ;['OOOOOOO OOOOOOO OOXOOOO OOXOOOO OOXOOOO OOXOYYY' ,'OOOOOOO OOOOOOO OOXOOOO OOYXOOO OOYOXOO OOYYOXY' ,'OOOOOOO,OOOOOOO,OOOOOOO,OOOOOOO,OOYYOOO,OYXXXXO' ,'OOOOOOO,OOOOOOO,OOOOOOO,XXXXOOO,YXYYOOO,YXYYXYX' ,'YXYYXOO,XYXXYOO,XXXYYOO,YYYXXOO,XXYYYYO,XXYYXXO'] .forEach(s => console.log(s,F(s))) ## JavaScript (ES6), 7776 69 bytes Saved 7 bytes thanks to Neil Takes input as a something-separated string, where something is basically any character. b=>[...'XXXXYYYY'].find((c,i)=>b.match((${c}.{${(i%4+6)%9}}){3}+c))  ### Test cases let f = b=>[...'XXXXYYYY'].find((c,i)=>b.match((${c}.{${(i%4+6)%9}}){3}+c)) console.log(f("OOOOOOO,OOOOOOO,OOOOOOO,OOOOOOO,OOYYOOO,OYXXXXO")) console.log(f("OOOOOOO,OOOOOOO,OOOOOOO,XXXXOOO,YXYYOOO,YXYYXYX")) console.log(f("YXYYXOO,XYXXYOO,XXXYYOO,YYYXXOO,XXYYYYO,XXYYXXO")) • Why not use b.match()? Should save on the RegExp call. – Neil Apr 21, 2017 at 8:04 • @Neil I totally forgot that match() was doing an implicit conversion to RegExp. Thanks! Apr 21, 2017 at 8:22 # Jelly, 25 22 bytes ŒgL⁼¥Ðf ;UŒD€;Z;$ç€4FṀ

Takes a list of strings (or list of list of characters) formed of X, Y, and O (would also work with replacements such that the space has a lower ordinal than both counters).

Try it online! or run an augmented version that takes a multiline string.

### How?

ŒgL⁼¥Ðf - Link 1, runs of given length: list A, length B  e.g. "XYYYXXO", 4
Œg      - group runs of equal elements of A                     ["X","YYY","XX","O"]
Ðf - filter keep:
L     -         length                                         1   3     2    1
⁼    -         equal to B?         (none kept in this case->) 0   0     0    0

;UŒD€;Z;$ç€4FṀ - Main link: list of list of chars (or list of stings) I U - reverse each row of I ; - I concatenated with that ŒD€ - positive diagonals of €ach (positive and negative diagonals)$      - last two links as a monad:
Z        -     transpose of I (i.e. the columns)
;       -     concatenated with I (columns + rows)
;         - concatenate (all the required directional slices)
ç€4   - call the last link (1) as a dyad for €ach with right argument = 4
F  - flatten the result
Ṁ - take the maximum ('Y'>'X'>'O') - this has the bonus effect of returning:
'Y' or 'X' for a winning board; and
'O' or '' for a (valid) game in progress.

# Python 2, 143 bytes

m=input()
u=[r[::-1]for r in m]
print"YX"[any(any('X'*4in''.join(t[i][j-i]for i in range(j+1))for j in range(6))for t in(m[::-1],m,u,u[::-1]))]

Takes a list of strings or a list of list of chars. Hard-coded for 6 rows by 7 columns, as the specification guarantees.

Try it online!

# K (ngn/k), 45 bytes

{"YX"@|//{&/'(x;+x),x@'/:|:\!4}''+'4'4''~2!x}

Try it online!

Takes a matrix of characters and returns one of X or Y. If simplified I/O is allowed (0, 1, 2 for X, O, Y for input and boolean for output), I can remove 2! from preprocessing and "YX"@ from postprocessing, giving 38 bytes.

### How it works

{"YX"@|//{&/'(x;+x),x@'/:|:\!4}''+'4'4''~2!x}   x: matrix of chars
~2!x       for each char, convert X to 1 and O/Y to 0
+'4'4''    extract all 4x4 sub-matrices using size-4 windows
{...}''    for each submatrix...
|:\!4        (0 1 2 3;3 2 1 0)
x@'/:        for each row of above, extract one element from each row of x
which gives the diagonal and the antidiagonal of x
(x;+x),      prepend x and transpose of x
&/'          reduce each by boolean AND
x -> vertical test, +x -> horizontal test
|//        repeat reducing by boolean OR until only one value remains
"YX"@      convert 1 to X and 0 to Y

• -3: trainify by removing { x}
– ngn
Aug 3, 2021 at 16:51

# Jelly, 19 bytes

UŒD;ŒD;Z;ṡ€4;/ṢEÞṪṪ

Try it online!

The core of this answer is copied from my answer to this very similar question.

## Explanation

UŒD;ŒD;Z;ṡ€4;/ṢEÞṪṪ
;  ; ;             Append {the input} and the following three values:
UŒD                     the antidiagonals of {the input};
ŒD                  the diagonals of {the input};
Z                the transposed {input}.
ṡ 4          Find all length-4 substrings
€             of each subarray within that.
;/        Flatten one level.
Þ     Sort, with the following sort order:
E        If all elements are the same, sort later.
Ṣ         Tiebreak via lexicographical order.
ṪṪ   Take the last element of the last element.

Fairly simple: we take all rows, columns, diagonals, and antidiagonals (just as in the n-queens validator), then take all length-4 substrings of those, then sort them in such a way that the winning line of 4 sorts to the end. (We need the tiebreak in case there's an OOOO in addition to the XXXX or YYYY.) Take the last element of the last element, and that'll be X or Y as required.

echo preg_match('#X(XXX|(.{8}X){3}|(.{7}X){3}|(.{9}X){3})#',$argn)?X:Y;  Online Version # Python 2, 201143129128 107 Bytes I decided to add horizontal, vertical, and diagonal together into one list and then add increment then look for X for times in it. And since there will always be a winner, I can assume Y won if X doesn't. This codes takes a matrix of all the different pieces and empty places. lambda m:"YX"[any("X"*4in"".join(a)for a in zip(*m)+m+zip(*["0"*(7-i)+m[i]+"00"*i+m[i]for i in range(6)]))]  Try it online! Credits • It's perfectly acceptable to self-answer. Apr 21, 2017 at 2:56 • Without looking too much at it, there seems to be useless whitespaces at: i:] for, i, r, r] for and 1 for. Apr 21, 2017 at 4:48 • @TuukkaX Thanks for the input, updated. – Neil Apr 21, 2017 at 4:50 • Also, *(len(m)-1) could be *~-len(m). How it works. Apr 21, 2017 at 4:54 • The ] for and 1 for are still there. Apr 21, 2017 at 5:02 # PowerShell, 666558 54 bytes I just check if X is the winner, as There will always be one winner, and only one winner. Thanks to edc65. Input is a string with no dividing character. Thanks to Arnauld. param($b)'YX'[1-in(0,5,6,7|%{$b-match"X(.{$_}X){3}"})]

Try it online!

# Python 3, 1059081 80 bytes

Regex based. Lines are space separated. Saved 9 bytes thanks to @Lynn.

Saved 1 byte by utilizing the fact that there is a guaranteed match. So if there's no win for X then there must be a win for Y.

lambda x:re.findall('X(XXX'+'|(.{%d}X){3}'*3%(6,7,8)+')',x)and'X'or'Y'
import re

Try it online!

• I think you can do something like: lambda x:re.findall('(X|Y)(z'+'|(.{%d}\\1){3}'*4%(0,6,7,8)+')',x)[0][0]
– Lynn
Mar 3, 2020 at 1:31
• @Lynn Good catch! Thanks. Saved 9 bytes. Mar 3, 2020 at 17:54

# Zsh, 207 ... 158 bytes

Version history: 4 iterations for ~25 bytes first week; then 3 more iterations for ~25 bytes 6 months later, 1 more for 1 byte 11 months later.

t(){a=($^a-$^@_);for s l (${w:^^argv}){s+=$l;i=;repeat $#s a[++i]+=$s[i+1];}}
w=(+)
t $@ for s;w[++j]=${(l:j:)}_
t $@ t${(Oa)@}
[[ \$a = *XXXX* ]]&&<<<X||<<<Y

(first) (second) (third) (fourth) (fifth) (sixth) (seventh) (eigth)

In the footer, I print both the input board and the array we build from it to stderr. Scroll down to debug to see them. The array we build is a lot longer now, since t does a cartesian product with input board on every call. (Hey, it shortened the code by a few bytes.)

There's a lot to cover here, so I moved the (sixth edition) comments to an annotated gist.

(tl;dr: concatenate transpositions of the original array, but make sure to keep them separated)

# Ruby, 84 bytes

Takes the board as a single continuous string with no separators. Finds a non-O character that's in a connect-4 and returns it.

->b{b[(0..41).find{|i|b[i]!=?O&&[1,6,7,8].any?{|j|(1..3).all?{|n|b[i+j*n]==b[i]}}}]}

Try it online!

# K (ngn/k), 58 55 56 bytes

{"XY"@|/&/'88<x ./:/:,/{x+/:/:+3+[4#1-+!3 3;]\&4}'+!6 7}

Try it online!

{ } function with argument x

+!6 7 all possible pairs of 0..5 and 0..6

{ }' for each of them do

4#1-+!3 3 are 4 of the 8 ortho-diagonal directions: (1 1;1 0;1 -1;0 1)

3+[ ]\&4 start with a list of four zeroes (&4) and make 3 steps in each of the directions

x+/:/: start from each possible position and take the steps in each possible direction

,/ concatenate. at this point we have a matrix of 4-lists of coordinate pairs, some of them extending beyond the board

x ./:/: look up the corresponding cells from x

88< which of them are "Y"-s? (88 is the ascii code of "X")

&/' which 4-lists consist only of "Y"-s? (and-reduce-each)

|/ is there at least one such? (or-reduce)

"XY"@ if false return "X", if true return "Y"

# J, 42 bytes

1 e.[:,4 4(*/"1@,|:,,{~3 0+3 5*/i.@4);._3]

Try it online!

Takes input as a matrix of integers where 0 is blank, 1 is X, and 2 is Y. Returns 1 if X wins, 0 if Y wins.

# 05AB1E (legacy), 2926 25 bytes

í‚εεÐм«NFÁ]€øIIø)J»γ4ùSà

Input as a character-matrix.

Uses the legacy version for -1 byte, since min/max also works on characters. In the new version of 05AB1E, the trailing à (maximum) should have been {θ instead (sort, keep last item).

Explanation:

í                 # Reverse each row of the (implicit) input-list
‚                # Pair it with the (implicit) input-list
ε               # Map over both matrices:
ε              #  Map over each row:
Ð             #   Triplicate the current row
м            #   Remove all these characters, leaving a list of empty strings of the
#   same size as the row
«           #   Merge this list of empty strings to the row
NF         #   Loop the (0-based) row-index amount of times:
Á        #    And rotate the row with appended empty strings towards the right
]               # Close the nested maps and inner loop
€              # For both mapped matrices:
ø             #  Zip/transpose; swapping rows/columns
# (we now have a list of all diagonals and anti-diagonals)
            # Push both lists of lists separated to the stack
I           # Push the input again
Iø         # And push the input, zipped/transposed
)        # Wrap everyone on the stack into a list
# (we now have a list of all diagonals, anti-diagonals, rows, and columns)
J       # Join each inner-most list of characters together to a string
»      # Join each inner list together to a string; and then join these strings
# with newline delimiter
γ     # Split everything into parts with equal adjacent characters
4ù   # Only keep the parts of length 4
S  # Flatten it to a list of characters
à # And get the maximum character of this list
# (after which it is output implicitly as result)

# Python 3.8 (pre-release), 114 112 bytes

Using a bitboard approach to check for 4 in a row.
Input: a 2D list of integers, where 0 represents empty cell, 1 is X, and 2 is Y.
Output: a positive integer if X wins, or 0 if Y wins.

lambda L:(b:=sum(sum(zip(*(L+[[0]*7])),())[i]%2<<i for i in range(49)))*any((r:=b&b<<i)&r<<i*2for i in(1,6,7,8))

Try it online!

## Explanation

The bitboard's layout is as follow (the missing positions in the last row is padded with 0):

0  8 16 24 32 40 48
1  9 17 25 33 41 49
2 10 18 26 34 42 50
3 11 19 27 35 43 51
4 12 20 28 36 44 52
5 13 21 29 37 45 53
6 14 22 30 38 46 54

This is the core of the function: given the bitboard b representing X's occupancies, check if X is winning:

any(
# shift the board by i, 2i, 3i, 4i and and all of them together
# if there's a set bit in the result (aka result != 0), then there is a 4-in-a-row
(r:=b&b<<i)&r<<i*2
# do this for all 4 directions
# 1: vertical, 7: horizontal, 6 and 8: diagonal
for i in(1,6,7,8)
)

This part contructs the bitboard b for X:

b:=sum(
sum(zip(*
(L+[[0]*7]) # append a row of 0 at the bottom of L
),())           # flatten L into a list, with the index correspond
#   to the correct position in the bitboard layout
[i]%2<<i        # set the ith bit to 1 if the new list has X (=1) at that index
for i in range(49)
) # sum all the set bits together to create the bitboard
`


text:
# Drag equation derivation?

1. Apr 5, 2009

### revolution200

I've been told I can derive the drag equation from momentum and force. I have also found a site that has a similar question but no solution.

http://www.physics.umd.edu/perg/abp/TPProbs/Problems/D/D30.htm

I have an idea of how to get a solution but get stuck.

2. Apr 5, 2009

### Bob S

Use the drag equation derivation given in the web site you referenced, and then recall that

a) Force (Newtons) times dx/dt (velocity, meters/sec) is joules per sec, or power.

b) Force (Newtons) times dt (sec) = mass times velocity = momentum change in time dt. (acceleration (or deceleration) times time is the velocity change in time dt). (recall that 1 Newton = 1 kilogram-meter per second^2)

You need to watch units very carefully. By the way, your reference is the drag derivation for high Reynold's number (turbulent flow). See the reference below for both types of drag.

http://en.wikipedia.org/wiki/Air_resistance

Last edited: Apr 5, 2009
3. Apr 5, 2009

### revolution200

Thank you, I've been told so many times that this doesn't exist. Thank you

4. Apr 5, 2009

### revolution200

I apologise but I've just tried using these references and I just don't understand. I'm not brilliant at these sort of problems could you please explain how these relate to the terms. Are they the description of the collisions with the wall and the particle. Do I put the force equal to the results you have given me?
m(dx/dt^2)=??
Apologies for my incompetence

5. Apr 5, 2009

### Bob S

OK. Iam not going to do your homework, but I am going to show you how to use the equations

Power
The power required to overcome the aerodynamic drag is given by:

P (power) = (1/2) rho A Cd v3

where rho = air density = 1.28 Kg per meter3

A = frontal area of car = 2.5 meters2

Cd - air drag coefficient = 0.32 (unitless, typical)

v= 100 kilometers per hour = 27.8 meters per second (about 62 mph)

Note that the power needed to push an object through a fluid increases as the cube of the velocity. A car cruising on a highway at 50 mph (80 km/h) may require only 10 horsepower (7.5 kW) to overcome air drag, but that same car at 100 mph (160 km/h) requires 80 hp (60 kW). With a doubling of speed the drag (force) quadruples per the formula. Exerting four times the force over a fixed distance produces four times as much work. At twice the speed the work (resulting in displacement over a fixed distance) is done twice as fast. Since power is the rate of doing work, four times the work done in half the time requires eight times the power.

Let's use the numbers and units above

P = (1/2) (1.28) (2.5) (.32) (27.8)3 = 11,000 (what are units?)

units =(Kg/m3) (m2) (m3/sec3) = (Kg-m/sec2) x (m/sec) = Newton-meters/sec = Joules/sec = watts

Converting to horespower we have P = 11,000 watts x 1Hp/746 watts = 14.7 Hp

OK. Now here is a problem for you.
Gasoline conains about 44,000 joules per gram of energy (heat of combustion)
there are 2750 grams of gasoline per U. S. gallon
The internal combustion engine (plus transmission) is about 15% efficient
You are burning gasoline at the rate of 11,000 watts (62 miles per hour-see above) for air drag

If your car is getting 20 miles per gallon, what fraction of that is air drag?

6. Apr 6, 2009

### revolution200

Thank you I really do appreciate your help and time. However it isn't the terms themselves that I don't understand.
If I have a block moving through the air with a frontal area A, it is pushing A times rho (units per Volume) particles of air. The force F(drag) created from this is from the momentum from the collision of these particles. What I'm stuck with is how do describe this in terms of momentum.
Now I know momentum is P = mv

therefore

P = m(dx/dt)

Now Force is the rate that momentum is done

this is where I get stuck

do I integrate from t0 to tn?

this gives

F(drag) = A*rho*m(integral from t0 to tn of (dx/dt).dt)

It can't be this because the drag equation doesn't have m and it doesn't make much sense anyway. Hence I'm stuck.

How do I calculate the rate? You can see from the drag equation that it is some integral since we have 1/2(v^2)

Thanks again for you response

I think it is something to do with this sorry for the long post

They are related by the fact that force is the rate at which momentum changes with respect to time (F = dp/dt). Note that if p = mv and m is constant, then F = dp/dt = m*dv/dt = ma. On the other hand, you can also say that the change in momentum is equal to the force multiplied by the time in which it was applied (or the integral of force with respect to time, if the force is not constant over the time period).

7. Apr 7, 2009

### Bob S

I attach a pdf copy of my derivation of air drag for automobiles. This differs slightly from the common derivation on the web, but it is easier and gets the same result.

#### Attached Files:

• ###### Aerodynamic Drag for Autos.pdf
File size:
49.8 KB
Views:
325
Last edited: Apr 7, 2009

format: plain


text:
It is currently 16 Dec 2017, 05:08

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# Events & Promotions

###### Events & Promotions in June
Open Detailed Calendar

# Unit's digit of large factorials with exponents?

Author Message
Intern
Joined: 02 Nov 2017
Posts: 1

Kudos [?]: 0 [0], given: 0

Unit's digit of large factorials with exponents? [#permalink]

### Show Tags

23 Nov 2017, 01:04
00:00

Difficulty:

(N/A)

Question Stats:

0% (00:00) correct 100% (00:00) wrong based on 1 sessions

### HideShow timer Statistics

if

$$\frac{((13!)^{16} -(13!)^8)}{(13!)^8+(13!)^4}$$ = a

then what is the unit's digit of $$\frac{a}{(13!)^4}$$

A) 0
B) 1
C) 3
D) 5
E) 9

Any input is appreciated, since I don't even know where to start on this one.
[Reveal] Spoiler: OA

Kudos [?]: 0 [0], given: 0

Math Expert
Joined: 02 Sep 2009
Posts: 42630

Kudos [?]: 135803 [0], given: 12714

Re: Unit's digit of large factorials with exponents? [#permalink]

### Show Tags

23 Nov 2017, 01:08
sebcroy wrote:
if

$$\frac{((13!)^{16} -(13!)^8)}{(13!)^8+(13!)^4}$$ = a

then what is the unit's digit of $$\frac{a}{(13!)^4}$$

A) 0
B) 1
C) 3
D) 5
E) 9

Any input is appreciated, since I don't even know where to start on this one.

Discussed here: https://gmatclub.com/forum/if-a-13-1-6- ... 65186.html Hope it helps.
_________________

Kudos [?]: 135803 [0], given: 12714

Re: Unit's digit of large factorials with exponents?   [#permalink] 23 Nov 2017, 01:08
Display posts from previous: Sort by

# Unit's digit of large factorials with exponents?

 Powered by phpBB © phpBB Group | Emoji artwork provided by EmojiOne Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®.


text:
Table 1: The PID terms and their effect on a control system.

 Term Math Function Effect on Control System P Proportional Typically the main drive in a control loop, KP reduces a large part of the overall error. I Integral ${K}_{I}\int {V}_{error}dt$ Reduces the final error in a system. Summing even a small error over time produces a drive signal large enough to move the system toward a smaller error. D Derivative ${k}_{D}\frac{d{V}_{error}}{dt}$ Counteracts the KP and KI terms when the output changes quickly. This helps reduce overshoot and ringing. It has no effect on the final error.


text:
1. ## Total relation

How can I proof that if $\displaystyle L$ is a universal relation that $\displaystyle R total relation\equiv L = L \circ R$. It is pretty obvious that it is true, but how do I prove it?

2. Could you explain what Rtotalrelation is? Also, is universal relation the one that contains all possible pairs? Finally, by $\displaystyle L\cdot R$ do you mean the composition $\displaystyle L\circ R$?

3. Originally Posted by emakarov
Could you explain what Rtotalrelation is? Also, is universal relation the one that contains all possible pairs? Finally, by $\displaystyle L\cdot R$ do you mean the composition $\displaystyle L\circ R$?
R total relation is

$\displaystyle R \equiv (\forall x |\exists z|: xRz))$

Yes, the universal relation is the one that contains all pairs

Yes, I did mean the composition. Edited the OP.

4. This is just a matter of using the notation.
If $\displaystyle (a,b)$ is any pair then $\displaystyle \left( {\exists c} \right)\left[ {(c,b) \in R} \right]$ because $\displaystyle R$ is total.
Because $\displaystyle L$ is universal $\displaystyle (a,c)\in L$ so $\displaystyle (a,b)\in L\circ R.$

5. Originally Posted by Plato
If $\displaystyle (a,b)$ is any pair then $\displaystyle \left( {\exists c} \right)\left[ {(c,b) \in R} \right]$ because $\displaystyle R$ is total.
Because $\displaystyle L$ is universal $\displaystyle (a,c)\in L$ so $\displaystyle (a,b)\in L\circ R.$
I think it should say that for any (a,b) there exists a $\displaystyle c$ such that $\displaystyle (a,c)\in R$ because R is total. Then $\displaystyle (c,b)\in L$ because L is universal, so $\displaystyle (a,b)\in L\circ R$.

6. Thanks, that is correct. It was either to early or the cut and paste.


text:
Shuo Zeng
California State Polytechnic University, Pomona
Data miningEconomicsPrincipal–agent problemComputer scienceSocial media
17Publications
8H-index
207Citations
What is this?
Publications 17
#1Xun Xu (California State University, Stanislaus)H-Index: 3
#1Xun Xu (California State University, Stanislaus)H-Index: 11
Last. Yuanjie He (CPP: California State Polytechnic University, Pomona)H-Index: 10
view all 3 authors...
Abstract Via the empirical evidences from Airbnb from eight major cities in U.S., we examine the role of information disclosure in influencing consumers' purchase behavior on this sharing economy platform. We analyze information disclosure from four aspects – namely, what information (i.e., information content), from where (i.e., information source), in what format (information presentation format), and how much (the quantity of information). We find all three information sources – providers, pl...
#1Shuo Zeng (CPP: California State Polytechnic University, Pomona)H-Index: 8
#2Moshe Dror (UA: University of Arizona)H-Index: 36
While there is vast literature on principal-agent service contracts in which a principal pools the service capacities of multiple agents for economy of scale, here we focus on the case that exists in practice of an agent pooling multiple principals. Since it is reasonable to presume that an agent of good standing attracts multiple contract offers, his main strategic decision is to select his principals. It is generally known that a principal can extract all economic surplus from a risk-neutral a...
#1Xun Xu (California State University, Stanislaus)H-Index: 11
#1Xun Xu (California State University, Stanislaus)H-Index: 3
Last. Yuanjie He (CPP: California State Polytechnic University, Pomona)H-Index: 10
view all 3 authors...
Remarketing and reselling remanufactured electronic products is one of the effective and sustainable approaches to deal with the rapidly increasing e-waste. Studying customer purchasing intention and behavior toward remanufactured products can help businesses better understand customers’ needs and improve closed-loop supply chain performance. Via an empirical study based on new, manufacturer remanufactured, seller remanufactured, and used products transaction data from eBay, one of the most popu...
#1Xun Xu (California State University, Stanislaus)H-Index: 11
#1Xun Xu (California State University, Stanislaus)H-Index: 3
Last. Shuo Zeng (CPP: California State Polytechnic University, Pomona)H-Index: 8
view all 3 authors...
With the rapid growth of online shopping, online sellers are facing more sales opportunities and challenges in the highly-competitive e-commerce market. Sellers that can generate high customer cumulative ratings may experience higher demand and profits. We explore the question of how sellers can attain those high ratings. Using leading online shopping websites in China and the U.S., we collected data for 200 online sellers in both countries for each of 40 product categories (16,000 observations)...
#1Shuo Zeng (UA: University of Arizona)H-Index: 8
#2Moshe Dror (UA: University of Arizona)H-Index: 36
In a basic principal-agent setting, the principal contracts an agent to perform a service function and the agent chooses the level of his capacity (his ‘effort’) in response to the contract offer and subsequently its effect on the principal’s revenue stream. We assume that the principal’s equipment unit generates revenue at an expected rate of r > 0 \$ per unit of uptime. The unit runs for a random period of time before failing, and remains in the failed state until it is repaired. To address the...
#1Shuo Zeng (UA: University of Arizona)H-Index: 8
#2Moshe Dror (UA: University of Arizona)H-Index: 36
When a risk-neutral agent accepts a contract offer (w, p), his expected utility rate is composed of the expected value of the compensation rate from the principal and a deterministic cost rate of the service capacity which can be expressed as $$w - pP(1)-\mu$$, where P(1) denotes the steady state probability of the unit being in the failed state. Similarly denote the steady state probability of the unit being operational by $$P(0) = 1 - P(1)$$.
#1Shuo Zeng (UA: University of Arizona)H-Index: 8
#2Moshe Dror (UA: University of Arizona)H-Index: 36
What if the agent is risk-averse. Fluctuations of the agent’s revenue stream occur because the principal’s equipment unit can be either in state 0 (‘operational’) or in state 1 (‘down’). In the operational state the penalty rate is 0, whereas in the down state the penalty rate is p. In other words, the penalty rate at any point of time can be modeled as pB where B is a Bernoulli random variable of value 0 with probability $$P(0) =\mu /(\lambda +\mu )$$ and value 1 with probability \(P(1) =\lambd...
#1Shuo Zeng (UA: University of Arizona)H-Index: 8
#2Moshe Dror (UA: University of Arizona)H-Index: 36
In previous section we represented agent’s perceived risk by a measure that reflects the dispersion of his revenue stream. Although the dispersion of possible outcomes has been widely used as the measure of risk (Pratt 1964; Rothschild and Stiglitz 1970; Stiglitz 1974; Levy 1992; Fukunaga and Huffman 2009; Lewis and Bajari 2014) it fails to capture observable behavior in risky settings. In this section we extend our principal-agent analysis to risk-seeking agent. We note that there is an ongoing...
#1Shuo Zeng (UA: University of Arizona)H-Index: 8
#2Moshe DrorH-Index: 36
This book examines contractual options for a performance based contract between an owner of a revenue generating unit and a repair agent for such unit. The framework of the analysis is that of economists' principal-agent problem. The contractual options of a principal and an agent are modeled as a Markov process with an undetermined time horizon. For a risk neutral principal, the authors identify the conditions under which a principal contracts with a risk-neutral, risk-averse, or risk-seeking a...
#1Shuo ZengH-Index: 8
12


text:
# It looks like $$e^x$$

Calculus Level 3

If the value of $$\displaystyle\sum_{n=0}^{\infty}\frac{n^2x^n}{n!}$$ is $$(ax^2+bx+c)e^x$$, where $$a$$, $$b$$, and $$c$$ are constants, enter the value of $$123a+456b+789c$$.

• $$\displaystyle e^x=\sum_{n=0}^\infty\frac{x^n}{n!}$$